From 91c30cd889f5997f99bb3102642d41a803d766fd Mon Sep 17 00:00:00 2001 From: Miodec Date: Fri, 23 Feb 2024 21:24:45 +0100 Subject: [PATCH] fix(caret): underline caret too low --- frontend/src/ts/test/caret.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/test/caret.ts b/frontend/src/ts/test/caret.ts index 526e7b658..c85530a6a 100644 --- a/frontend/src/ts/test/caret.ts +++ b/frontend/src/ts/test/caret.ts @@ -112,7 +112,11 @@ export async function updatePosition(noAnim = false): Promise { const diff = letterHeight - caret.offsetHeight; - const newTop = letterPosTop + diff / 2; + let newTop = letterPosTop + diff / 2; + + if (Config.caretStyle === "underline") { + newTop = letterPosTop - caret.offsetHeight / 2; + } let newLeft = letterPosLeft - (fullWidthCaret ? 0 : caretWidth / 2);