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

Jan Holesovsky kendy at collabora.com
Fri Dec 20 10:46:01 PST 2013


 vcl/source/gdi/outdev3.cxx |   22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 8fb0aff43cc0f7d25536bb5c7382dd54970fce36
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Dec 20 19:33:03 2013 +0100

    hidpi: Let's be brave & always paint odd heights with Hi-DPI ;-)
    
    Change-Id: Ib374d5636a296663c8dde71827f1bca96f545e51

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index ce5a9e6..3feb9bf 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5309,13 +5309,13 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
 
         if (mnDPIScaleFactor > 1)
         {
-            nStartY++; //Shift down an additional pixel to create more visual separation.
             nWaveHeight *= mnDPIScaleFactor;
 
-            //5 pixels looks better than 6.
-            if (mnDPIScaleFactor == 2 && nWaveHeight == 6)
+            // odd heights look better than even
+            if (mnDPIScaleFactor % 2 == 0)
             {
-                nWaveHeight = 5;
+                nStartY++; // Shift down an additional pixel to create more visual separation.
+                nWaveHeight--;
             }
         }
     }
commit c63324e0fdcfcaa21f48bdbae289954eee5922aa
Author: Keith Curtis <keithcu at gmail.com>
Date:   Fri Dec 20 19:27:10 2013 +0100

    hidpi: Nicer painting of the waved lines.
    
    Change-Id: I8773b47967bc1aa8cf33b9a1edc4f826291d3554

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 99b09db9..ce5a9e6 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5306,6 +5306,18 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
         nWaveHeight = 3;
         nStartY++;
         nEndY++;
+
+        if (mnDPIScaleFactor > 1)
+        {
+            nStartY++; //Shift down an additional pixel to create more visual separation.
+            nWaveHeight *= mnDPIScaleFactor;
+
+            //5 pixels looks better than 6.
+            if (mnDPIScaleFactor == 2 && nWaveHeight == 6)
+            {
+                nWaveHeight = 5;
+            }
+        }
     }
     else if( nStyle == WAVE_SMALL )
     {
@@ -5316,13 +5328,13 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
     else // WAVE_FLAT
         nWaveHeight = 1;
 
-     // #109280# make sure the waveline does not exceed the descent to avoid paint problems
-     ImplFontEntry* pFontEntry = mpFontEntry;
-     if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
-         nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
+    // #109280# make sure the waveline does not exceed the descent to avoid paint problems
+    ImplFontEntry* pFontEntry = mpFontEntry;
+    if( nWaveHeight > pFontEntry->maMetric.mnWUnderlineSize )
+        nWaveHeight = pFontEntry->maMetric.mnWUnderlineSize;
 
     ImplDrawWaveLine(nStartX, nStartY, 0, 0,
-            nEndX-nStartX, nWaveHeight * mnDPIScaleFactor,
+            nEndX-nStartX, nWaveHeight,
             mnDPIScaleFactor, nOrientation, GetLineColor());
 
     if( mpAlphaVDev )


More information about the Libreoffice-commits mailing list