Commit 2f1c7b16 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

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.
parent fcaa5991
...@@ -328,16 +328,25 @@ static UINT SCROLL_GetThumbVal( SCROLLBAR_INFO *infoPtr, RECT *rect, ...@@ -328,16 +328,25 @@ static UINT SCROLL_GetThumbVal( SCROLLBAR_INFO *infoPtr, RECT *rect,
static BOOL SCROLL_PtInRectEx( LPRECT lpRect, POINT pt, BOOL vertical ) static BOOL SCROLL_PtInRectEx( LPRECT lpRect, POINT pt, BOOL vertical )
{ {
RECT rect = *lpRect; 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) if (vertical)
{ {
rect.left -= lpRect->right - lpRect->left; scrollbarWidth = lpRect->right - lpRect->left;
rect.right += lpRect->right - lpRect->left; rect.left -= scrollbarWidth*8;
rect.right += scrollbarWidth*8;
rect.top -= scrollbarWidth*2;
rect.bottom += scrollbarWidth*2;
} }
else else
{ {
rect.top -= lpRect->bottom - lpRect->top; scrollbarWidth = lpRect->bottom - lpRect->top;
rect.bottom += lpRect->bottom - lpRect->top; rect.left -= scrollbarWidth*2;
rect.right += scrollbarWidth*2;
rect.top -= scrollbarWidth*8;
rect.bottom += scrollbarWidth*8;
} }
return PtInRect( &rect, pt ); return PtInRect( &rect, pt );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment