Compare commits

..

2 Commits

Author SHA1 Message Date
84ab0895f8 Fix TextView scrolling 2024-07-27 00:19:53 -04:00
b9c77fd5f7 ScrollContainer properly responds to pgup/down 2024-07-27 00:19:31 -04:00
2 changed files with 3 additions and 1 deletions

View File

@ -200,6 +200,7 @@ func (this *ScrollContainer) handleKeyDown (key input.Key, numpad bool) bool {
} else { } else {
vector.Y -= this.PageSize().Y vector.Y -= this.PageSize().Y
} }
this.scrollBy(vector)
return true return true
case input.KeyPageDown: case input.KeyPageDown:
if modifiers.Shift { if modifiers.Shift {
@ -207,6 +208,7 @@ func (this *ScrollContainer) handleKeyDown (key input.Key, numpad bool) bool {
} else { } else {
vector.Y += this.PageSize().Y vector.Y += this.PageSize().Y
} }
this.scrollBy(vector)
return true return true
} }
return false return false

View File

@ -22,6 +22,6 @@ func NewTextView (text string) *TextView {
} }
func (this *TextView) handleScroll (x, y float64) bool { func (this *TextView) handleScroll (x, y float64) bool {
this.ScrollTo(this.ContentBounds().Min.Add(image.Pt(int(x), int(y)))) this.ScrollTo(this.ContentBounds().Min.Sub(image.Pt(int(x), int(y))))
return true return true
} }