fix: alignment means nothing to a frame that is its whole line
Probed: an as-char frame alone in a paragraph makes a line exactly as tall as itself whatever style:vertical-pos/-rel says — only from-top's offset still lengthens it. The node view cannot see its siblings, so the block's class overrides the alignment it wrote.
This commit is contained in:
1 parent
6c7f7834e9
commit
0d3506a51c
2 files changed
+8
-4
No files matched your search
@@ -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 = '';
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in new issue
Block a user