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:
@@ -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 )
|
||||||
|
Reference in New Issue
Block a user