Scrollbars accept both directions of scroll
This commit is contained in:
parent
4fc44c11e8
commit
2722d19ecd
10
scrollbar.go
10
scrollbar.go
|
@ -235,6 +235,16 @@ func (this *Scrollbar) handleMouseMove () bool {
|
|||
|
||||
func (this *Scrollbar) handleScroll (x, y float64) bool {
|
||||
if this.layout.linked == nil { return false }
|
||||
|
||||
delta := (x + y)
|
||||
if this.layout.vertical {
|
||||
x = 0
|
||||
y = delta
|
||||
} else {
|
||||
x = delta
|
||||
y = 0
|
||||
}
|
||||
|
||||
this.layout.linked.ScrollTo (
|
||||
this.layout.linked.ContentBounds().Min.
|
||||
Sub(image.Pt(int(x), int(y))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user