vcl/source/window/decoview.cxx |   43 +++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

New commits:
commit 734d2cb4348426483d0070b6bc1a71d74661f904
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Mar 8 21:49:14 2019 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Mar 9 15:03:32 2019 +0100

    replace feeble triangle drawing with DrawPolygon
    
    which will result in a hidpi triangle rather than
    a bunch of visible lines arranged in a triangle pattern
    
    Change-Id: I9208177aa5e32791f46c9b1dcbe71f5442475282
    Reviewed-on: https://gerrit.libreoffice.org/68946
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index c1fb51df019e..d9eef51a59ed 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -158,6 +158,7 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle 
nRect, const SymbolTyp
         case SymbolType::SPIN_LEFT:
         case SymbolType::FIRST:
         case SymbolType::PREV:
+        {
             nRect.AdjustLeft(n4 );
             if ( eType==SymbolType::FIRST )
             {
@@ -165,21 +166,25 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle 
nRect, const SymbolTyp
                                 Point( nRect.Left(), nRect.Bottom() ) );
                 nRect.AdjustLeft( 1 );
             }
-            pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) );
-            for ( long i=1; i <= n2; ++i )
-            {
-                nRect.AdjustLeft( 1 );
-                pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-i ),
-                                Point( nRect.Left(), aCenter.Y()+i ) );
-                pDev->DrawPixel( Point( nRect.Left(), aCenter.Y()-i ) );
-                pDev->DrawPixel( Point( nRect.Left(), aCenter.Y()+i ) );
-            }
+
+            tools::Polygon aTriangle(3);
+            aTriangle.SetPoint(Point(nRect.Left() + n2,  aCenter.Y() - n2), 0);
+            aTriangle.SetPoint(Point(nRect.Left(), aCenter.Y()), 1);
+            aTriangle.SetPoint(Point(nRect.Left() + n2, aCenter.Y() + n2), 2);
+
+            pDev->Push(PushFlags::LINECOLOR);
+            pDev->SetLineColor();
+            pDev->DrawPolygon(aTriangle);
+            pDev->Pop();
+
             break;
+        }
 
         case SymbolType::SPIN_RIGHT:
         case SymbolType::LAST:
         case SymbolType::NEXT:
         case SymbolType::PLAY:
+        {
             nRect.AdjustRight( -n4 );
             if ( eType==SymbolType::LAST )
             {
@@ -187,16 +192,18 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle 
nRect, const SymbolTyp
                                 Point( nRect.Right(), nRect.Bottom() ) );
                 nRect.AdjustRight( -1 );
             }
-            pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) );
-            for ( long i=1; i <= n2; ++i )
-            {
-                nRect.AdjustRight( -1 );
-                pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-i ),
-                                Point( nRect.Right(), aCenter.Y()+i ) );
-                pDev->DrawPixel( Point( nRect.Right(), aCenter.Y()-i ) );
-                pDev->DrawPixel( Point( nRect.Right(), aCenter.Y()+i ) );
-            }
+
+            tools::Polygon aTriangle(3);
+            aTriangle.SetPoint(Point(nRect.Right() - n2,  aCenter.Y() - n2), 
0);
+            aTriangle.SetPoint(Point(nRect.Right(), aCenter.Y()), 1);
+            aTriangle.SetPoint(Point(nRect.Right() - n2, aCenter.Y() + n2), 2);
+
+            pDev->Push(PushFlags::LINECOLOR);
+            pDev->SetLineColor();
+            pDev->DrawPolygon(aTriangle);
+            pDev->Pop();
             break;
+        }
 
         case SymbolType::PAGEUP:
             pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to