From 5668bf7c35e6bb050ec951db8ee142a446d4f6bd Mon Sep 17 00:00:00 2001 From: narzoul Date: Fri, 14 Jul 2017 11:31:55 +0200 Subject: [PATCH] Repaint scrolled area when smooth scrolling is disabled When the SW_SMOOTHSCROLL flag is removed in ScrollWindowEx, it needs to be replaced with SW_ERASE and SW_INVALIDATE to properly repaint the scrolled portions of the window. Fixes an issue reported in #16. --- DDrawCompat/Gdi/ScrollFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DDrawCompat/Gdi/ScrollFunctions.cpp b/DDrawCompat/Gdi/ScrollFunctions.cpp index 9e6b19d..1bd735f 100644 --- a/DDrawCompat/Gdi/ScrollFunctions.cpp +++ b/DDrawCompat/Gdi/ScrollFunctions.cpp @@ -27,7 +27,7 @@ namespace if (flags & SW_SMOOTHSCROLL) { - flags = LOWORD(flags ^ SW_SMOOTHSCROLL); + flags = (LOWORD(flags) & ~SW_SMOOTHSCROLL) | SW_INVALIDATE | SW_ERASE; } int result = CALL_ORIG_FUNC(ScrollWindowEx)(