From ce520f71fd4c9a54a7000464f367d639d9d338ee Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 29 Oct 2023 18:09:10 +0800 Subject: [PATCH] :art: fixhttps://github.com/siyuan-note/siyuan/issues/9545 --- app/src/protyle/wysiwyg/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 0635c78d1..7dfdb1942 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -365,9 +365,9 @@ export class WYSIWYG { } const documentSelf = document; const rect = protyle.element.getBoundingClientRect(); - const mostLeft = rect.left + parseInt(protyle.wysiwyg.element.style.paddingLeft) + 1; + const mostLeft = rect.left + (parseInt(protyle.wysiwyg.element.style.paddingLeft) || 24) + 1; // 不能用 firstElement,否则 https://ld246.com/article/1668758661338 - const mostRight = mostLeft + (protyle.wysiwyg.element.clientWidth - parseInt(protyle.wysiwyg.element.style.paddingLeft) - parseInt(protyle.wysiwyg.element.style.paddingRight)) - 2; + const mostRight = mostLeft + (protyle.wysiwyg.element.clientWidth - (parseInt(protyle.wysiwyg.element.style.paddingLeft) || 24) - (parseInt(protyle.wysiwyg.element.style.paddingRight) || 16)) - 2; const mostBottom = rect.bottom; const y = event.clientY;