diff options
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 11 |
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); |