Reset text scrolling at the wrap boundary
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user