Fixed two bugs: 1. one doubled arrow scrolled in the wrong direction. 2. When the mouse exited the view while scrolling, the scrollbar would stopped scrolling.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13407 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-07-02 17:00:44 +00:00
parent 3e054be14b
commit 72f32ccaf8

View File

@ -100,7 +100,7 @@ public:
delete fScrollRunner;
fScrollRunner = NULL;
};
bool fEnabled;
// TODO: This should be a static, initialized by
@ -536,9 +536,9 @@ BScrollBar::MouseDown(BPoint pt)
if (buttonrect.Contains(pt)) {
fPrivateData->fButtonDown = ARROW3;
fPrivateData->fArrowDown = B_RIGHT_ARROW;
SetValue(Value() + fSmallStep);
SetValue(Value() - fSmallStep);
fPrivateData->StartMessageRunner(this, fSmallStep);
fPrivateData->StartMessageRunner(this, -fSmallStep);
return;
}
@ -597,18 +597,15 @@ BScrollBar::MouseMoved(BPoint pt, uint32 transit, const BMessage *msg)
if (!fPrivateData->fEnabled)
return;
if (transit == B_EXITED_VIEW || transit == B_OUTSIDE_VIEW)
MouseUp(fPrivateData->fMousePos);
if (fPrivateData->fTracking) {
float delta;
if (fOrientation == B_VERTICAL) {
if( (pt.y > fPrivateData->fThumbFrame.bottom && fValue == fMax) ||
if ((pt.y > fPrivateData->fThumbFrame.bottom && fValue == fMax) ||
(pt.y < fPrivateData->fThumbFrame.top && fValue == fMin) )
return;
delta = pt.y - fPrivateData->fMousePos.y;
} else {
if((pt.x > fPrivateData->fThumbFrame.right && fValue == fMax) ||
if ((pt.x > fPrivateData->fThumbFrame.right && fValue == fMax) ||
(pt.x < fPrivateData->fThumbFrame.left && fValue == fMin))
return;
delta = pt.x - fPrivateData->fMousePos.x;