From aaa794ac0493b6be50acb0215781c2e00f5db583 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Fri, 10 Mar 2023 13:41:47 -0500 Subject: [PATCH] ScrollBar handles scroll wheel events --- elements/basic/scrollbar.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/elements/basic/scrollbar.go b/elements/basic/scrollbar.go index 8f75938..74ede7e 100644 --- a/elements/basic/scrollbar.go +++ b/elements/basic/scrollbar.go @@ -123,7 +123,11 @@ func (element *ScrollBar) HandleMouseMove (x, y int) { } func (element *ScrollBar) HandleMouseScroll (x, y int, deltaX, deltaY float64) { - + if element.vertical { + element.scrollBy(int(deltaY)) + } else { + element.scrollBy(int(deltaX)) + } } // SetEnabled sets whether or not the scroll bar can be interacted with.