Skip to content

Commit d42c2e9

Browse files
fixed scrolling with mouse wheel issue
1 parent 624ca4d commit d42c2e9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

workspace.go

+7
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ func (work *Workspace) Init(parent Window) {
6969
work.SetSetCursorEventHandler(work.updateCursor)
7070
work.SetHScrollEventHandler(work.HScroll)
7171
work.SetVScrollEventHandler(work.VScroll)
72+
work.SetMouseWheelEventHandler(func(e *MouseWheelEvent) {
73+
if e.WheelDelta > 0 {
74+
work.ScrollUp()
75+
} else {
76+
work.ScrollDown()
77+
}
78+
})
7279

7380
color := Rgb(255, 255, 255)
7481
brushWhite := win.HBRUSH(win.GetStockObject(win.WHITE_BRUSH))

0 commit comments

Comments
 (0)