[Libreoffice-commits] core.git: Branch 'feature/borderline' - drawinglayer/source svx/source

Armin Le Grand Armin.Le.Grand at cib.de
Fri Jul 7 11:32:33 UTC 2017


 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx |    2 
 svx/source/dialog/framelinkarray.cxx                      |   78 +++++++++++---
 2 files changed, 67 insertions(+), 13 deletions(-)

New commits:
commit 048c2a5842e6eccb5c6422e120140cd3ac4a3e16
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Fri Jul 7 13:32:45 2017 +0200

    borderline: correct line dash visualization
    
    When a dashed line is used, a factor of 10.0 was applied in the
    original coded, added that. Also the orientation of vertical
    borders was inverted since it was simpler to exchange Start/End,
    but this also mirrors the line dash visualisation, corrected that
    
    Change-Id: I77418cc6c84ebb0632f8c3448976e82ce612d6b6

diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index 2bb7eb869289..f9a3ce78f468 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -62,7 +62,7 @@ namespace drawinglayer
             aPolygon.append(rEnd);
 
             const attribute::LineAttribute aLineAttribute(rColor, fWidth);
-            static double fPatScFact(1.0); // 10.0 multiply, see old code
+            static double fPatScFact(10.0); // 10.0 multiply, see old code
             const std::vector<double> aDashing(svtools::GetLineDashing(aStyle, fPatternScale * fPatScFact));
 
             if (aDashing.empty())
diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx
index 1b3406eafcdf..24f432e3b97d 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -1005,9 +1005,20 @@ void Array::DrawRange( drawinglayer::processor2d::BaseProcessor2D& rProcessor,
                     drawinglayer::primitive2d::Primitive2DContainer aSequence(1);
                     aSequence.append(
                         CreateBorderPrimitives(
-                            aStartPos, aEndPos, *pStart,
-                            aStartLFromTR, *pStartLFromT, *pStartLFromL, *pStartLFromB, aStartLFromBR,
-                            aEndRFromTL, *pEndRFromT, *pEndRFromR, *pEndRFromB, aEndRFromBL, pForceColor));
+                            aStartPos,
+                            aEndPos,
+                            *pStart,
+                            aStartLFromTR,
+                            *pStartLFromT,
+                            *pStartLFromL,
+                            *pStartLFromB,
+                            aStartLFromBR,
+                            aEndRFromTL,
+                            *pEndRFromT,
+                            *pEndRFromR,
+                            *pEndRFromB,
+                            aEndRFromBL,
+                            pForceColor));
                     rProcessor.process(aSequence);
                 }
 
@@ -1036,9 +1047,20 @@ void Array::DrawRange( drawinglayer::processor2d::BaseProcessor2D& rProcessor,
             drawinglayer::primitive2d::Primitive2DContainer aSequence(1);
             aSequence.append(
                 CreateBorderPrimitives(
-                    aStartPos, aEndPos, *pStart,
-                    aStartLFromTR, *pStartLFromT, *pStartLFromL, *pStartLFromB, aStartLFromBR,
-                    aEndRFromTL, *pEndRFromT, *pEndRFromR, *pEndRFromB, aEndRFromBL, pForceColor));
+                    aStartPos,
+                    aEndPos,
+                    *pStart,
+                    aStartLFromTR,
+                    *pStartLFromT,
+                    *pStartLFromL,
+                    *pStartLFromB,
+                    aStartLFromBR,
+                    aEndRFromTL,
+                    *pEndRFromT,
+                    *pEndRFromR,
+                    *pEndRFromB,
+                    aEndRFromBL,
+                    pForceColor));
             rProcessor.process(aSequence);
         }
     }
@@ -1095,9 +1117,28 @@ void Array::DrawRange( drawinglayer::processor2d::BaseProcessor2D& rProcessor,
                     drawinglayer::primitive2d::Primitive2DContainer aSequence(1);
                     aSequence.append(
                         CreateBorderPrimitives(
-                            aEndPos, aStartPos, *pStart,
-                            aEndBFromTL, *pEndBFromL, *pEndBFromB, *pEndBFromR, aEndBFromTR,
-                            aStartTFromBL, *pStartTFromL, *pStartTFromT, *pStartTFromR, aStartTFromBR, pForceColor));
+                            // This replaces DrawVerFrameBorder which went from top to bottom. To be able to use
+                            // the same method as for horizontal (CreateBorderPrimitives), the given borders
+                            // have to be rearranged. Best is to look at the explanations of parameters in
+                            // framelink.hxx and the former calls to DrawVerFrameBorder and it's parameters.
+                            // In principle, the order of the five TFrom and BFrom has to be
+                            // inverted to get the same orientation. Before, EndPos and StartPos were changed
+                            // which avoids the reordering, but also leads to inverted line patters for vertical
+                            // lines
+                            aStartPos,
+                            aEndPos,
+                            *pStart,
+                            aStartTFromBR,
+                            *pStartTFromR,
+                            *pStartTFromT,
+                            *pStartTFromL,
+                            aStartTFromBL,
+                            aEndBFromTR,
+                            *pEndBFromR,
+                            *pEndBFromB,
+                            *pEndBFromL,
+                            aEndBFromTL,
+                            pForceColor));
                     rProcessor.process(aSequence);
                 }
 
@@ -1125,9 +1166,22 @@ void Array::DrawRange( drawinglayer::processor2d::BaseProcessor2D& rProcessor,
         {
             drawinglayer::primitive2d::Primitive2DContainer aSequence(1);
             aSequence.append(
-                CreateBorderPrimitives(aEndPos, aStartPos, *pStart,
-                    aEndBFromTL, *pEndBFromL, *pEndBFromB, *pEndBFromR, aEndBFromTR,
-                    aStartTFromBL, *pStartTFromL, *pStartTFromT, *pStartTFromR, aStartTFromBR, pForceColor));
+                CreateBorderPrimitives(
+                    // also reordered, see call to CreateBorderPrimitives above
+                    aStartPos,
+                    aEndPos,
+                    *pStart,
+                    aStartTFromBR,
+                    *pStartTFromR,
+                    *pStartTFromT,
+                    *pStartTFromL,
+                    aStartTFromBL,
+                    aEndBFromTR,
+                    *pEndBFromR,
+                    *pEndBFromB,
+                    *pEndBFromL,
+                    aEndBFromTL,
+                    pForceColor));
             rProcessor.process(aSequence);
         }
     }


More information about the Libreoffice-commits mailing list