mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-20 23:36:37 +08:00
fixed wide carets moved too far left
This commit is contained in:
parent
374251bc39
commit
5cbc7c6646
|
@ -36,10 +36,14 @@ export async function updatePosition(): Promise<void> {
|
|||
// }
|
||||
|
||||
const caret = $("#caret");
|
||||
const caretWidth = Math.round(
|
||||
let caretWidth = Math.round(
|
||||
document.querySelector("#caret")?.getBoundingClientRect().width ?? 0
|
||||
);
|
||||
|
||||
if (["block", "outline", "underline"].includes(Config.caretStyle)) {
|
||||
caretWidth /= 3;
|
||||
}
|
||||
|
||||
let inputLen = TestInput.input.current.length;
|
||||
inputLen = Misc.trailingComposeChars.test(TestInput.input.current)
|
||||
? TestInput.input.current.search(Misc.trailingComposeChars) + 1
|
||||
|
|
Loading…
Reference in a new issue