From b5e7f21065a908b0815ecba46c977a58ed4a529d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 4 Dec 2013 14:33:07 +0000 Subject: [PATCH] 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 --- include/wx/generic/statbmpg.h | 4 ++-- src/common/ctrlcmn.cpp | 2 +- src/osx/bmpbuttn_osx.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/generic/statbmpg.h b/include/wx/generic/statbmpg.h index 8a8fa15dfd..f3d198df4e 100644 --- a/include/wx/generic/statbmpg.h +++ b/include/wx/generic/statbmpg.h @@ -60,8 +60,8 @@ public: private: wxSize GetBitmapSize() { - return m_bitmap.IsOk() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()) - : wxSize(16, 16); // this is completely arbitrary + return m_bitmap.IsOk() ? m_bitmap.GetScaledSize() + : wxSize(16, 16); // this is completely arbitrary } void OnPaint(wxPaintEvent& event); diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 32bce06c6f..dbfbc9f700 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -584,7 +584,7 @@ wxSize wxStaticBitmapBase::DoGetBestSize() const wxSize best; wxBitmap bmp = GetBitmap(); if ( bmp.IsOk() ) - best = wxSize(bmp.GetWidth(), bmp.GetHeight()); + best = bmp.GetScaledSize(); else // this is completely arbitrary best = wxSize(16, 16); diff --git a/src/osx/bmpbuttn_osx.cpp b/src/osx/bmpbuttn_osx.cpp index 581ddd0865..fcc4b9ccf2 100644 --- a/src/osx/bmpbuttn_osx.cpp +++ b/src/osx/bmpbuttn_osx.cpp @@ -66,7 +66,7 @@ wxSize wxBitmapButton::DoGetBestSize() const if ( GetBitmapLabel().IsOk() ) { - best += GetBitmapLabel().GetSize(); + best += GetBitmapLabel().GetScaledSize(); } return best;