Skip to content

Commit

Permalink
fix(caret): underline caret too low
Browse files Browse the repository at this point in the history
  • Loading branch information
Miodec committed Feb 23, 2024
1 parent 01aefa9 commit 91c30cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/ts/test/caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ export async function updatePosition(noAnim = false): Promise<void> {

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);

Expand Down

0 comments on commit 91c30cd

Please sign in to comment.