From: Vadim Zeitlin Date: Sun, 20 Jun 1999 21:34:39 +0000 (+0000) Subject: better update rect calculation X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7c5457867870a0a33951def66373f5a76ec3ae4a?hp=051205e611a461fa3c23d37a1bfa648834b885a0 better update rect calculation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 727d02e67f..c22387c146 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -189,7 +189,6 @@ void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) int w, h; GetPosition(&x, &y); GetSize(&w, &h); - RECT rect = { x, y, x + w, y + h }; #ifdef __WIN32__ HANDLE handle = m_isIcon ? (HANDLE)m_image.icon->GetHICON() @@ -204,10 +203,14 @@ void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) height = bitmap.GetHeight(); if ( width && height ) { + w = width; + h = height; + ::MoveWindow((HWND)GetHWND(), x, y, width, height, FALSE); } } + RECT rect = { x, y, x + w, y + h }; InvalidateRect((HWND)GetParent()->GetHWND(), &rect, TRUE); }