fix: draw native list attachment markers

This commit is contained in:
Valdemar Lorenzen
2026-10-19 13:05:52 +02:00
parent 85425ee71b
commit e14b195856
3 changed files with 38 additions and 3 deletions
+4 -3
View File
@@ -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))
}
}