From 868de40a8282e575774cdb650577cdb12a96c13f Mon Sep 17 00:00:00 2001 From: Matthew Wilber Date: Sat, 15 Nov 2003 13:12:18 +0000 Subject: [PATCH] Fixed issue where view scrolls to the left when mouse wheel is used, changed to scroll faster if the wheel is scrolled multiple clicks per B_MOUSE_WHEEL_CHANGED message, increased the scroll speed git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5375 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/ShowImageView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/showimage/ShowImageView.cpp b/src/apps/showimage/ShowImageView.cpp index 0f2ab6455b..2ef597938f 100644 --- a/src/apps/showimage/ShowImageView.cpp +++ b/src/apps/showimage/ShowImageView.cpp @@ -1033,14 +1033,15 @@ ShowImageView::KeyDown (const char * bytes, int32 numBytes) void ShowImageView::MouseWheelChanged(BMessage *msg) { + const float kscrollBy = 40; float dy, dx; float x, y; x = 0; y = 0; if (msg->FindFloat("be:wheel_delta_x", &dx) == B_OK) { - x = dx > 0 ? 20 : -20; + x = dx * kscrollBy; } if (msg->FindFloat("be:wheel_delta_y", &dy) == B_OK) { - y = dy > 0 ? 20 : -20; + y = dy * kscrollBy; } ScrollRestrictedBy(x, y); }