fix: draw native list attachment markers
This commit is contained in:
@@ -33,9 +33,10 @@ private final class ListAttachmentCell: NSTextAttachmentCell {
|
||||
nonisolated override func cellBaselineOffset() -> NSPoint { NSPoint(x: 0, y: -3) }
|
||||
override func draw(withFrame cellFrame: NSRect, in controlView: NSView?) {
|
||||
guard !stringValue.isEmpty else { return }
|
||||
var frame = cellFrame
|
||||
frame.size.width -= 4
|
||||
super.draw(withFrame: frame, in: controlView)
|
||||
let label = attributedStringValue
|
||||
let size = label.size()
|
||||
label.draw(at: NSPoint(x: cellFrame.maxX - 4 - size.width,
|
||||
y: cellFrame.midY - size.height / 2))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user