From 7c5457867870a0a33951def66373f5a76ec3ae4a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 20 Jun 1999 21:34:39 +0000 Subject: [PATCH] better update rect calculation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/statbmp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.45.2