user32: Increased area for scrolling via mouse drag outside scrollbar.

When dragging the scrollbar thumb with the mouse, the mouse is able to
move away from the scrollbar and keep scrolling so long as it isn't too
far away from the scrollbar.  This makes it easier to quickly scroll
with the mouse.

All that this patch changes is the distance that the mouse can be moved
away from the scrollbar before it is consider outside of the scrollbar
and returns to its original position.  The distances are proportional to
the size of the scrollbar.
This commit is contained in:
Dylan Smith 2008-07-03 11:03:12 -04:00 committed by Alexandre Julliard
parent fcaa599181
commit 2f1c7b1610
1 changed files with 13 additions and 4 deletions

View File

@ -328,16 +328,25 @@ static UINT SCROLL_GetThumbVal( SCROLLBAR_INFO *infoPtr, RECT *rect,
static BOOL SCROLL_PtInRectEx( LPRECT lpRect, POINT pt, BOOL vertical )
{
RECT rect = *lpRect;
int scrollbarWidth;
/* Pad hit rect to allow mouse to be dragged outside of scrollbar and
* still be considered in the scrollbar. */
if (vertical)
{
rect.left -= lpRect->right - lpRect->left;
rect.right += lpRect->right - lpRect->left;
scrollbarWidth = lpRect->right - lpRect->left;
rect.left -= scrollbarWidth*8;
rect.right += scrollbarWidth*8;
rect.top -= scrollbarWidth*2;
rect.bottom += scrollbarWidth*2;
}
else
{
rect.top -= lpRect->bottom - lpRect->top;
rect.bottom += lpRect->bottom - lpRect->top;
scrollbarWidth = lpRect->bottom - lpRect->top;
rect.left -= scrollbarWidth*2;
rect.right += scrollbarWidth*2;
rect.top -= scrollbarWidth*8;
rect.bottom += scrollbarWidth*8;
}
return PtInRect( &rect, pt );
}