diff --git a/src/lib/editor/extensions/image.ts b/src/lib/editor/extensions/image.ts index 5ff6ee6..5e7108e 100644 --- a/src/lib/editor/extensions/image.ts +++ b/src/lib/editor/extensions/image.ts @@ -368,6 +368,9 @@ class ImageView { this.dom.style.height = `${bh}px`; this.dom.style.verticalAlign = inlineVerticalAlign(this.node.attrs.vAlign, bh, this.node.attrs.wrapOffsetY); + // A frame alone on its line is the whole line, so where it sits against a baseline + // no longer means anything — except an offset, which still lengthens the line. + this.dom.dataset.vAlign = String(this.node.attrs.vAlign ?? ''); } else { this.rotor.style.width = ''; this.rotor.style.height = ''; diff --git a/src/styles/editor.css b/src/styles/editor.css index a9028b5..4996c8f 100644 --- a/src/styles/editor.css +++ b/src/styles/editor.css @@ -279,10 +279,11 @@ vertical-align: baseline; line-height: 0; } -/* Alone on its line (image.ts marks the block) the frame sets the line height by - itself: no descent hangs below it, so it sits on the line bottom, not the baseline. */ -.paper .tiptap .image-line .image-node { - vertical-align: bottom; +/* Alone on its line (image.ts marks the block) the frame sets the line height by itself: + no descent hangs below it, and every vertical-pos but `offset` is moot (probed). Beats + the node view's own inline alignment, which has no other way to know. */ +.paper .tiptap .image-line .image-node:not([data-v-align='offset']) { + vertical-align: bottom !important; } /* While selected, lift the node (and its handles) above the header/footer layer (z-index 22) so a rotate/resize handle poking into a margin stays grabbable. */