[Libreoffice-commits] core.git: vcl/source

Norbert Thiebaud nthiebaud at gmail.com
Thu Feb 13 22:14:01 CET 2014


 vcl/source/window/toolbox2.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit c4ecc15b2515ac8873099ded82b1e69f54187444
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Thu Feb 13 11:43:39 2014 -0600

    fast scale doubling of biptmap mess up mac retina but is needed otherwise
    
    Change-Id: I3d4a4bbbd85719fbf1422d9397727dd73bd09f37

diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 9f6a1af..00b11d8 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1379,6 +1379,20 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
     {
         Image aImage(rImage);
 
+#ifndef MACOSX
+        if ( GetDPIScaleFactor() > 1)
+        {
+            BitmapEx aBitmap(aImage.GetBitmapEx());
+
+            // Some code calls this twice, so add a sanity check
+            // FIXME find out what that code is & fix accordingly
+            if (aBitmap.GetSizePixel().Width() < 32)
+            {
+                aBitmap.Scale(GetDPIScaleFactor(), GetDPIScaleFactor(), BMP_SCALE_FAST);
+                aImage = Image(aBitmap);
+            }
+        }
+#endif
         ImplToolItem* pItem = &mpData->m_aItems[nPos];
         // Nur wenn alles berechnet ist, mehr Aufwand treiben
         if ( !mbCalc )


More information about the Libreoffice-commits mailing list