From bc2460caf19ee67f690f9138da04f8e25d22ca48 Mon Sep 17 00:00:00 2001 From: Wijnand Modderman-Lenstra Date: Thu, 29 Oct 2026 17:28:14 +0100 Subject: [PATCH] Reset text scrolling at the wrap boundary --- app/widget/text.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/widget/text.go b/app/widget/text.go index 5a3a83a..2d0b63a 100644 --- a/app/widget/text.go +++ b/app/widget/text.go @@ -135,9 +135,9 @@ func (w *Text) Refresh(ctx app.Context) bool { scrollRequired := textWidth > bounds.Dx() if scrollRequired && w.scrollDir != 0 && now.Sub(w.scrollLast) >= w.scrollRate { w.scroll.X += w.scrollDir - if w.scroll.X > (textWidth + w.scrollGap) { + if w.scroll.X >= (textWidth + w.scrollGap) { w.scroll.X = 0 - } else if w.scroll.X < -(textWidth + w.scrollGap) { + } else if w.scroll.X <= -(textWidth + w.scrollGap) { w.scroll.X = 0 } w.scrollLast = now