summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-05 17:13:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-06 10:02:05 +0100
commit15cdcd0346b7aa98d4697edec8aeea9c810efa62 (patch)
treec6def99e690a53fefde0cfcbe90cf2105e16a00c /drawinglayer
parent097d12bd738467765ae9aa0f4129cf3153510241 (diff)
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@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx25
1 files changed, 20 insertions, 5 deletions
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);