From 7ee6c7efe3bb70eeb183393be60b9fab502959dd Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 28 Sep 2023 00:48:08 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/9294 --- app/src/protyle/gutter/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index 51cedbdad38..5dfb106b9d4 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -1876,7 +1876,16 @@ export class Gutter { (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; } - this.element.style.top = `${Math.max(rect.top, wysiwyg.parentElement.getBoundingClientRect().top) + marginHeight}px`; + if (nodeElement.getAttribute("data-type") === "NodeAttributeView") { + const iconElement = nodeElement.querySelector(".item__graphic"); + if (iconElement) { + this.element.style.top = `${iconElement.getBoundingClientRect().top - (window.siyuan.config.editor.fontSize * 1.625 - 14) / 2}px`; + } else { + this.element.style.top = `${Math.max(rect.top, wysiwyg.parentElement.getBoundingClientRect().top) + 8}px`; + } + } else { + this.element.style.top = `${Math.max(rect.top, wysiwyg.parentElement.getBoundingClientRect().top) + marginHeight}px`; + } let left = rect.left - this.element.clientWidth - space; if (nodeElement.getAttribute("data-type") === "NodeBlockQueryEmbed" && this.element.childElementCount === 1) { // 嵌入块为列表时