From 76190de960abbf1fb8b7798fbf88c7f4a978935b Mon Sep 17 00:00:00 2001 From: JulianSmart Date: Sun, 15 Nov 2015 18:54:10 +0000 Subject: [PATCH] Only use scaled content factor for bitmaps on Mac --- src/propgrid/propgrid.cpp | 5 +++++ src/richtext/richtextbuffer.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index eb39b8b999..2db7ed4d07 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -4660,7 +4660,12 @@ void wxPropertyGrid::OnResize( wxSizeEvent& event ) if ( !HasExtraStyle(wxPG_EX_NATIVE_DOUBLE_BUFFERING) ) { + // Scaled bitmaps only work on Mac currently +#ifdef __WXOSX_COCOA__ double scaleFactor = GetContentScaleFactor(); +#else + double scaleFactor = 1.0; +#endif int dblh = (m_lineHeight*2); if ( !m_doubleBuffer ) { diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 5eca53a888..32b4c0dedf 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -12681,8 +12681,11 @@ bool wxRichTextImage::LoadAndScaleImageCache(wxImage& image, const wxSize& sz, w else { double scaleFactor = 1.0; + // Scaled bitmaps only work on Mac currently +#ifdef __WXOSX_COCOA__ if (context.GetBuffer() && context.GetBuffer()->GetRichTextCtrl()) scaleFactor = context.GetBuffer()->GetRichTextCtrl()->GetContentScaleFactor(); +#endif // If the original width and height is small, e.g. 400 or below, // scale up and then down to improve image quality. This can make