diff --git a/src/main/scala/ocelot/desktop/ui/widget/TextInput.scala b/src/main/scala/ocelot/desktop/ui/widget/TextInput.scala index 502ab95..8cf5e68 100644 --- a/src/main/scala/ocelot/desktop/ui/widget/TextInput.scala +++ b/src/main/scala/ocelot/desktop/ui/widget/TextInput.scala @@ -139,12 +139,6 @@ class TextInput(val initialText: String = "") extends Widget with MouseHandler w if (button != MouseEvent.Button.Right || !selection.active || clamped < selection.from || clamped > selection.to) { setCursorAndSelectionPosition(clamped) } - // more special logic: keep `selection.from` updated even if there is no selection active - // in case there will be a follow-up drag event, which usually has some lag between initial click and following drag, - // and we would not want our mouse selection to lag - if (!selection.active) { - selection.from = clamped - } } } @@ -295,6 +289,8 @@ class TextInput(val initialText: String = "") extends Widget with MouseHandler w cursor.position = position if (selection.active) { selection.to = cursor.position + } else { + selection.from = cursor.position } }