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
This commit is contained in:
parent
71f1dfd147
commit
868de40a82
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user