From 0212c53b07900bb00889aa30c4218c6e7f73c181 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 28 Dec 2023 23:46:18 +0800 Subject: [PATCH] =?UTF-8?q?:lipstick:=20=E8=A1=8C=E5=9D=97=E6=A0=87?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/gutter/index.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index f600ef2c2..3a0646360 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -2027,13 +2027,14 @@ data-type="fold"> Math.floor(window.siyuan.config.editor.fontSize * 1.625) + 8 && rect.height < Math.floor(window.siyuan.config.editor.fontSize * 1.625) * 2 + 8)) { - marginHeight = (rect.height - this.element.clientHeight) / 2; - } else if (!element.classList.contains("av__row") && - (nodeElement.getAttribute("data-type") === "NodeAttributeView" || element.getAttribute("data-type") === "NodeAttributeView") && - contentTop < rect.top) { - marginHeight = 8; + } else if (!element.classList.contains("av__row")) { + if (rect.height < Math.floor(window.siyuan.config.editor.fontSize * 1.625) + 8 || + (rect.height > Math.floor(window.siyuan.config.editor.fontSize * 1.625) + 8 && rect.height < Math.floor(window.siyuan.config.editor.fontSize * 1.625) * 2 + 8)) { + marginHeight = (rect.height - this.element.clientHeight) / 2; + } else if ((nodeElement.getAttribute("data-type") === "NodeAttributeView" || element.getAttribute("data-type") === "NodeAttributeView") && + contentTop < rect.top) { + marginHeight = 8; + } } this.element.style.top = `${Math.max(rect.top, contentTop) + marginHeight}px`; let left = rect.left - this.element.clientWidth - space;