summaryrefslogtreecommitdiff
path: root/vcl/quartz/salgdicommon.cxx
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/quartz/salgdicommon.cxx
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/quartz/salgdicommon.cxx')
-rw-r--r--vcl/quartz/salgdicommon.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index eaf40deed5e4..e493be1a75fe 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -961,7 +961,8 @@ bool AquaSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolyLine,
double fTransparency,
const basegfx::B2DVector& rLineWidths,
basegfx::B2DLineJoin eLineJoin,
- css::drawing::LineCap eLineCap)
+ css::drawing::LineCap eLineCap,
+ double fMiterMinimumAngle)
{
DBG_DRAW_OPERATION("drawPolyLine", true);
@@ -1000,7 +1001,8 @@ bool AquaSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolyLine,
case basegfx::B2DLineJoin::Miter: aCGLineJoin = kCGLineJoinMiter; break;
case basegfx::B2DLineJoin::Round: aCGLineJoin = kCGLineJoinRound; break;
}
-
+ // convert miter minimum angle to miter limit
+ CGFloat fCGMiterLimit = 1.0 / sin(fMiterMinimumAngle / 2.0);
// setup cap attribute
CGLineCap aCGLineCap(kCGLineCapButt);
@@ -1047,6 +1049,7 @@ bool AquaSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolyLine,
CGContextSetLineJoin( mrContext, aCGLineJoin );
CGContextSetLineCap( mrContext, aCGLineCap );
CGContextSetLineWidth( mrContext, rLineWidths.getX() );
+ CGContextSetMiterLimit(mrContext, fCGMiterLimit);
SAL_INFO( "vcl.cg", "CGContextDrawPath(" << mrContext << ",kCGPathStroke)" );
CGContextDrawPath( mrContext, kCGPathStroke );
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << mrContext << ") " << mnContextStackDepth-- );