summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2016-04-09 23:15:09 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2016-04-26 16:42:27 +0000
commit32cec4ca8bf1e09dd33aa461984e8e8ae34f4a7c (patch)
tree5591a63de12179505a0e7a4870632754585152d3 /vcl/headless
parent4905c8bf7834b1ca79139c62f4e8b0672e9ddc13 (diff)
tdf#48066 render stroke-miterlimit correctly in SVG import
The property stroke-miterlimit is transported to the renderers via a new member mfMiterMinimumAngle in class LineAttribute Several drawPolyLine methods are adapted. This patch does not include changes in MetaAction. Presentation mode, printing, and PDF-export is still wrong. Corrected LineJoinMiter to LineJoinBevel in canvas, that s closer to NONE. Removed DrawPolyLine method without MiterMinimumAngle and adapted calls accordingly. Change-Id: I6bcd24add5d85c4d9a39e3788e0682091c5fc9c4 Reviewed-on: https://gerrit.libreoffice.org/23946 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpgdi.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 37e0e17bbbe2..b6c33b709e24 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -27,6 +27,7 @@
#include <vcl/sysdata.hxx>
#include <config_cairo_canvas.h>
+#include <basegfx/numeric/ftools.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2ibox.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -538,7 +539,7 @@ void SvpSalGraphics::drawPolyLine(sal_uInt32 nPoints, const SalPoint* pPtAry)
aPoly.setClosed(false);
drawPolyLine(aPoly, 0.0, basegfx::B2DVector(1.0, 1.0), basegfx::B2DLineJoin::Miter,
- css::drawing::LineCap_BUTT);
+ css::drawing::LineCap_BUTT, 15.0 * F_PI180 /*default*/);
}
void SvpSalGraphics::drawPolygon(sal_uInt32 nPoints, const SalPoint* pPtAry)
@@ -699,7 +700,8 @@ bool SvpSalGraphics::drawPolyLine(
double fTransparency,
const basegfx::B2DVector& rLineWidths,
basegfx::B2DLineJoin eLineJoin,
- css::drawing::LineCap eLineCap)
+ css::drawing::LineCap eLineCap,
+ double fMiterMinimumAngle)
{
// short circuit if there is nothing to do
const int nPointCount = rPolyLine.count();
@@ -729,6 +731,9 @@ bool SvpSalGraphics::drawPolyLine(
break;
}
+ // convert miter minimum angle to miter limit
+ double fMiterLimit = 1.0 / sin( fMiterMinimumAngle / 2.0);
+
// setup cap attribute
cairo_line_cap_t eCairoLineCap(CAIRO_LINE_CAP_BUTT);
@@ -759,7 +764,7 @@ bool SvpSalGraphics::drawPolyLine(
cairo_set_line_join(cr, eCairoLineJoin);
cairo_set_line_cap(cr, eCairoLineCap);
cairo_set_line_width(cr, rLineWidths.getX());
- cairo_set_miter_limit(cr, 15.0);
+ cairo_set_miter_limit(cr, fMiterLimit);
basegfx::B2DRange extents(0, 0, 0, 0);