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

Caolán McNamara caolanm at redhat.com
Wed Dec 6 09:03:45 UTC 2017


 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   25 ++++++++++++----
 1 file changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 15cdcd0346b7aa98d4697edec8aeea9c810efa62
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Dec 5 17:13:28 2017 +0000

    Related: tdf#105998 except cut and paste as bitmap instead of export
    
    Take a drawing rectangle in draw and cut and paste as bitmap to writer.  The
    hairline border along the very right/bottom edge of the bitmap appear missing.
    
    fallback to default handlers which can distort the hairline to be visible
    
    Change-Id: Iedb580f65879628839c83e41092745ae7c11267c
    Reviewed-on: https://gerrit.libreoffice.org/45902
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 9c21c83ee8f8..5c5c0bb93b34 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -41,6 +41,7 @@
 #include "helperwrongspellrenderer.hxx"
 #include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
 #include <vcl/hatch.hxx>
 #include <tools/diagnose_ex.h>
 #include <com/sun/star/awt/PosSize.hpp>
@@ -139,7 +140,7 @@ namespace drawinglayer
             }
 
             //Resolves: tdf#105998 if we are a hairline along the very right/bottom edge
-            //of the canvas then destroy the polygon inwards one pixel right/bottom so that
+            //of the canvas then distort the polygon inwards one pixel right/bottom so that
             //the hairline falls inside the paintable area and becomes visible
             Size aSize = mpOutputDevice->GetOutputSize();
             basegfx::B2DRange aRange = aLocalPolygon.getB2DRange();
@@ -210,10 +211,6 @@ namespace drawinglayer
                 maBColorModifierStack.getModifiedColor(
                     rSource.getLineAttribute().getColor()));
 
-            mpOutputDevice->SetFillColor();
-            mpOutputDevice->SetLineColor(Color(aLineColor));
-            aHairLinePolyPolygon.transform(maCurrentTransformation);
-
             double fLineWidth(rSource.getLineAttribute().getWidth());
 
             if(basegfx::fTools::more(fLineWidth, 0.0))
@@ -234,6 +231,24 @@ namespace drawinglayer
                 fLineWidth = 0.0;
             }
 
+            //Related: tdf#105998 cut and paste as bitmap of shape from draw to
+            //writer.  If we are a hairline along the very right/bottom edge of
+            //the canvas then fallback to defaults which can distort the
+            //hairline inside the paintable area
+            if (fLineWidth == 0.0)
+            {
+                Size aSize = mpOutputDevice->GetOutputSize();
+                basegfx::B2DRange aRange = aHairLinePolyPolygon.getB2DRange();
+                basegfx::B2DRange aOutputRange = aRange;
+                aOutputRange.transform(maCurrentTransformation);
+                if (std::round(aOutputRange.getMaxX()) == aSize.Width() || std::round(aOutputRange.getMaxY()) == aSize.Height())
+                    return false;
+            }
+
+            mpOutputDevice->SetFillColor();
+            mpOutputDevice->SetLineColor(Color(aLineColor));
+            aHairLinePolyPolygon.transform(maCurrentTransformation);
+
             bool bHasPoints(false);
             bool bTryWorked(false);
 


More information about the Libreoffice-commits mailing list