From c4337a432459de06a63049b06b56ff78c442eba4 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 7 Mar 2014 17:01:41 -0500 Subject: [PATCH] BView: style fixes related to mouse scrolling --- src/kits/interface/View.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index 84da3eda82..99904d8e3e 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -4405,22 +4405,24 @@ BView::MessageReceived(BMessage* message) break; } - float deltaX = 0.0f, deltaY = 0.0f; + float deltaX = 0.0f; + float deltaY = 0.0f; + if (horizontal != NULL) message->FindFloat("be:wheel_delta_x", &deltaX); + if (vertical != NULL) message->FindFloat("be:wheel_delta_y", &deltaY); if (deltaX == 0.0f && deltaY == 0.0f) break; - if (horizontal != NULL) { + if (horizontal != NULL) ScrollWithMouseWheelDelta(horizontal, deltaX); - } - if (vertical != NULL) { + if (vertical != NULL) ScrollWithMouseWheelDelta(vertical, deltaY); - } + break; } @@ -5721,7 +5723,8 @@ BView::ScrollWithMouseWheelDelta(BScrollBar* scrollBar, float delta) if (scrollBar == NULL || delta == 0.0f) return; - float smallStep, largeStep; + float smallStep; + float largeStep; scrollBar->GetSteps(&smallStep, &largeStep); // pressing the shift key scrolls faster (following the pseudo-standard set