wxOSX Retina fixes: size wxStaticBitmap and wxBitmapButton properly.
The size is expressed in logical coordinates and needs to use bitmap's scaled size, otherwise it would appear twice as large in both dimensions. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4156e1a5c9
commit
b5e7f21065
@ -60,7 +60,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
wxSize GetBitmapSize()
|
wxSize GetBitmapSize()
|
||||||
{
|
{
|
||||||
return m_bitmap.IsOk() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight())
|
return m_bitmap.IsOk() ? m_bitmap.GetScaledSize()
|
||||||
: wxSize(16, 16); // this is completely arbitrary
|
: wxSize(16, 16); // this is completely arbitrary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,7 +584,7 @@ wxSize wxStaticBitmapBase::DoGetBestSize() const
|
|||||||
wxSize best;
|
wxSize best;
|
||||||
wxBitmap bmp = GetBitmap();
|
wxBitmap bmp = GetBitmap();
|
||||||
if ( bmp.IsOk() )
|
if ( bmp.IsOk() )
|
||||||
best = wxSize(bmp.GetWidth(), bmp.GetHeight());
|
best = bmp.GetScaledSize();
|
||||||
else
|
else
|
||||||
// this is completely arbitrary
|
// this is completely arbitrary
|
||||||
best = wxSize(16, 16);
|
best = wxSize(16, 16);
|
||||||
|
@ -66,7 +66,7 @@ wxSize wxBitmapButton::DoGetBestSize() const
|
|||||||
|
|
||||||
if ( GetBitmapLabel().IsOk() )
|
if ( GetBitmapLabel().IsOk() )
|
||||||
{
|
{
|
||||||
best += GetBitmapLabel().GetSize();
|
best += GetBitmapLabel().GetScaledSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
return best;
|
return best;
|
||||||
|
Loading…
Reference in New Issue
Block a user