feat(editor): reading polish — inline images, rhythm, table padding, margins (#71 follow-up 6)
- Images render inline via NSTextAttachment (scaled to 480pt, alt as caption); the hover popover and its ImagePopoverView are gone. - Vertical rhythm per the author's measurements: lineHeightMultiple 1.25, 1 line after paragraphs, 2 after headings (all block styles). - Table cells breathe: mono pad 2→3 per side; decoration offsets measure with the same pad so the grid still lands on the text. - Margins: lineFragmentPadding 12→24 (reading + editing), inset height 24. - Image URL resolution hoisted into blocks(for:) — the attachment loads the resolved path, document() no longer re-resolves.
This commit is contained in:
1 parent
7ed7a56642
commit
2d4e2563f7
3 files changed
+67
-18
No files matched your search
@@ -68,8 +68,8 @@ struct ReadingSurface: NSViewRepresentable {
|
||||
// view width — a fixed 640pt measure clipped in narrower columns.
|
||||
tv.textContainer?.containerSize = NSSize(width: 0, height: CGFloat.greatestFiniteMagnitude)
|
||||
tv.textContainer?.widthTracksTextView = true
|
||||
tv.textContainer?.lineFragmentPadding = 12
|
||||
tv.textContainerInset = NSSize(width: 0, height: 20)
|
||||
tv.textContainer?.lineFragmentPadding = 24
|
||||
tv.textContainerInset = NSSize(width: 0, height: 24)
|
||||
let scroll = NSScrollView()
|
||||
scroll.documentView = tv
|
||||
scroll.hasVerticalScroller = true
|
||||
|
||||
Reference in new issue
Block a user