AI Fix offset

This commit is contained in:
mcDandy
2026-10-13 14:10:44 +02:00
parent 1ef9f4b074
commit 09f5435590
3 changed files with 7 additions and 14 deletions
+3 -8
View File
@@ -1,6 +1,6 @@
<template>
<div
class="mrmth-editor"
class="mrmth-editor mrmth-editor-v2"
data-mrmth-script-widget="vue"
ref="wrapperRef"
:style="editorStyle"
@@ -323,11 +323,8 @@ const refresh = () => {
prevOffset.value = baselineDelta;
const halfLineCorrection = lhPx / 2;
const adjustedBaseline = baselineDelta - halfLineCorrection;
// Apply translation to gutter
gutterContent.style.transform = `translateY(${adjustedBaseline - scrollTop.value}px)`;
gutterContent.style.transform = `translateY(${baselineDelta - scrollTop.value}px)`;
const parent = wrapperRef.value?.parentElement;
if (parent && parent.clientHeight > 0) {
@@ -356,9 +353,7 @@ const onScroll = () => {
}
if (gutterContent) {
const halfLineCorrection = (parseFloat(textareaStyles.value.lineHeight) || 17.4) / 2;
const adjustedBaseline = prevOffset.value - halfLineCorrection;
gutterContent.style.transform = `translateY(${adjustedBaseline - textarea.scrollTop}px)`;
gutterContent.style.transform = `translateY(${prevOffset.value - textarea.scrollTop}px)`;
}
};