better update rect calculation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2841 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -189,7 +189,6 @@ void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
|||||||
int w, h;
|
int w, h;
|
||||||
GetPosition(&x, &y);
|
GetPosition(&x, &y);
|
||||||
GetSize(&w, &h);
|
GetSize(&w, &h);
|
||||||
RECT rect = { x, y, x + w, y + h };
|
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
HANDLE handle = m_isIcon ? (HANDLE)m_image.icon->GetHICON()
|
HANDLE handle = m_isIcon ? (HANDLE)m_image.icon->GetHICON()
|
||||||
@@ -204,10 +203,14 @@ void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
|||||||
height = bitmap.GetHeight();
|
height = bitmap.GetHeight();
|
||||||
if ( width && height )
|
if ( width && height )
|
||||||
{
|
{
|
||||||
|
w = width;
|
||||||
|
h = height;
|
||||||
|
|
||||||
::MoveWindow((HWND)GetHWND(), x, y, width, height, FALSE);
|
::MoveWindow((HWND)GetHWND(), x, y, width, height, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RECT rect = { x, y, x + w, y + h };
|
||||||
InvalidateRect((HWND)GetParent()->GetHWND(), &rect, TRUE);
|
InvalidateRect((HWND)GetParent()->GetHWND(), &rect, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user