https://git.reactos.org/?p=reactos.git;a=commitdiff;h=68af472a2133fb8e6859a7...
commit 68af472a2133fb8e6859a7a9d5363385b995f891 Author: Giannis Adamopoulos gadamopoulos@reactos.org AuthorDate: Thu Nov 23 21:17:03 2017 +0200
[UXTHEME] Improve drawing of the scrollbars when they are too small. CORE-13513 --- dll/win32/uxtheme/ncscrollbar.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dll/win32/uxtheme/ncscrollbar.c b/dll/win32/uxtheme/ncscrollbar.c index 27299f867d..8d6f21de69 100644 --- a/dll/win32/uxtheme/ncscrollbar.c +++ b/dll/win32/uxtheme/ncscrollbar.c @@ -126,6 +126,9 @@ static enum SCROLL_HITTEST SCROLL_HitTest( HWND hwnd, SCROLLBARINFO* psbi, BOOL
static void SCROLL_ThemeDrawPart(PDRAW_CONTEXT pcontext, int iPartId,int iStateId, SCROLLBARINFO* psbi, int htCurrent, int htDown, int htHot, RECT* r) { + if (r->right <= r->left || r->bottom <= r->top) + return; + if(psbi->rgstate[htCurrent] & STATE_SYSTEM_UNAVAILABLE) iStateId += BUTTON_DISABLED - BUTTON_NORMAL; else if (htHot == htCurrent) @@ -187,17 +190,22 @@ static void SCROLL_DrawInterior( PDRAW_CONTEXT pcontext, SCROLLBARINFO* psbi, r = psbi->rcScrollBar; if (vertical) { - thumbPos += pcontext->wi.rcClient.top - pcontext->wi.rcWindow.top; + if (thumbPos) + thumbPos += pcontext->wi.rcClient.top - pcontext->wi.rcWindow.top; r.top += psbi->dxyLineButton; r.bottom -= (psbi->dxyLineButton); } else { - thumbPos += pcontext->wi.rcClient.left - pcontext->wi.rcWindow.left; + if (thumbPos) + thumbPos += pcontext->wi.rcClient.left - pcontext->wi.rcWindow.left; r.left += psbi->dxyLineButton; r.right -= psbi->dxyLineButton; }
+ if (r.right <= r.left || r.bottom <= r.top) + return; + /* Draw the scroll rectangles and thumb */
if (!thumbPos) /* No thumb to draw */