From b69eb6b62ecb53e3692548f63d0220ad5f85310a Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 18 Jan 2023 16:01:31 -0500 Subject: [PATCH] Tweaked text box scrolling --- elements/basic/textbox.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elements/basic/textbox.go b/elements/basic/textbox.go index b48e9be..6e29c98 100644 --- a/elements/basic/textbox.go +++ b/elements/basic/textbox.go @@ -244,7 +244,7 @@ func (element *TextBox) scrollToCursor () { cursorPosition := element.valueDrawer.PositionOf(element.cursor) cursorPosition.X -= element.scroll maxX := bounds.Max.X - minX := bounds.Min.X + bounds.Dx() / 2 + minX := maxX if cursorPosition.X > maxX { element.scroll += cursorPosition.X - maxX } else if cursorPosition.X < minX {