Kaydet (Commit) 15cdcd03 authored tarafından Caolán McNamara's avatar Caolán McNamara

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/45902Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 097d12bd
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "helperwrongspellrenderer.hxx" #include "helperwrongspellrenderer.hxx"
#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx> #include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <vcl/hatch.hxx> #include <vcl/hatch.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
#include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/awt/PosSize.hpp>
...@@ -139,7 +140,7 @@ namespace drawinglayer ...@@ -139,7 +140,7 @@ namespace drawinglayer
} }
//Resolves: tdf#105998 if we are a hairline along the very right/bottom edge //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 //the hairline falls inside the paintable area and becomes visible
Size aSize = mpOutputDevice->GetOutputSize(); Size aSize = mpOutputDevice->GetOutputSize();
basegfx::B2DRange aRange = aLocalPolygon.getB2DRange(); basegfx::B2DRange aRange = aLocalPolygon.getB2DRange();
...@@ -210,10 +211,6 @@ namespace drawinglayer ...@@ -210,10 +211,6 @@ namespace drawinglayer
maBColorModifierStack.getModifiedColor( maBColorModifierStack.getModifiedColor(
rSource.getLineAttribute().getColor())); rSource.getLineAttribute().getColor()));
mpOutputDevice->SetFillColor();
mpOutputDevice->SetLineColor(Color(aLineColor));
aHairLinePolyPolygon.transform(maCurrentTransformation);
double fLineWidth(rSource.getLineAttribute().getWidth()); double fLineWidth(rSource.getLineAttribute().getWidth());
if(basegfx::fTools::more(fLineWidth, 0.0)) if(basegfx::fTools::more(fLineWidth, 0.0))
...@@ -234,6 +231,24 @@ namespace drawinglayer ...@@ -234,6 +231,24 @@ namespace drawinglayer
fLineWidth = 0.0; 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 bHasPoints(false);
bool bTryWorked(false); bool bTryWorked(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment