From 59065bb29e9e7e85cca83eb6dd5ccdd99533a183 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Fri, 21 Apr 2023 22:04:38 +0800 Subject: [PATCH] fix: inline image ascent value --- src/editor/core/draw/Draw.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/core/draw/Draw.ts b/src/editor/core/draw/Draw.ts index c0ffc2e..8e5a292 100644 --- a/src/editor/core/draw/Draw.ts +++ b/src/editor/core/draw/Draw.ts @@ -1023,7 +1023,8 @@ export class Draw { metrics.boundingBoxDescent += metrics.height / 2 } } - const ascent = element.type === ElementType.IMAGE || element.type === ElementType.LATEX + const ascent = (element.imgDisplay !== ImageDisplay.INLINE && element.type === ElementType.IMAGE) || + element.type === ElementType.LATEX ? metrics.height : metrics.boundingBoxAscent + rowMargin const height = rowMargin + metrics.boundingBoxAscent + metrics.boundingBoxDescent + rowMargin