Don't do anything when ScrollWindow(0, 0) is called in wxMSW

This doesn't really change anything, but just skips executing some code
uselessly if we know in advance we are not going to do anything, which
is nice as ScrollWindow() actually ends up being called with 0 arguments
surprisingly often from wxScrollHelperBase::SetScrollRate().

This is also consistent with what wxGTK does.
This commit is contained in:
Vadim Zeitlin
2018-06-25 15:49:50 +02:00
parent 107e66e725
commit 0fa00b5159

View File

@@ -1144,6 +1144,9 @@ void wxWindowMSW::SetScrollbar(int orient,
void wxWindowMSW::ScrollWindow(int dx, int dy, const wxRect *prect) void wxWindowMSW::ScrollWindow(int dx, int dy, const wxRect *prect)
{ {
if ( !dx && !dy )
return;
RECT rect; RECT rect;
RECT *pr; RECT *pr;
if ( prect ) if ( prect )