(svn r87) Fix: rare mousewheel scrolling with scrollbar crash
This commit is contained in:
3
window.c
3
window.c
@@ -85,8 +85,7 @@ void DispatchRightClickEvent(Window *w, int x, int y) {
|
|||||||
|
|
||||||
void DispatchMouseWheelEvent(Window *w, int wheel)
|
void DispatchMouseWheelEvent(Window *w, int wheel)
|
||||||
{
|
{
|
||||||
|
if (w->vscroll.count > w->vscroll.cap) {
|
||||||
if (w->vscroll.count) {
|
|
||||||
int pos = clamp(w->vscroll.pos + wheel, 0, w->vscroll.count - w->vscroll.cap);
|
int pos = clamp(w->vscroll.pos + wheel, 0, w->vscroll.count - w->vscroll.cap);
|
||||||
if (pos != w->vscroll.pos) {
|
if (pos != w->vscroll.pos) {
|
||||||
w->vscroll.pos = pos;
|
w->vscroll.pos = pos;
|
||||||
|
|||||||
Reference in New Issue
Block a user