From 2a0cd925bebb0c7d3513db311b185a04f259b68d Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 17 Jan 2012 16:54:04 +0000 Subject: linecap: Reintegrating finished LineCap feature, kudos to Regina Henschel for doing the basic implementation and offering it under apache license --- vcl/win/source/gdi/salgdi_gdiplus.cxx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'vcl/win') diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx index f8430d25bc5d..6fc73b86d02c 100644 --- a/vcl/win/source/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx @@ -187,7 +187,12 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly return true; } -bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin eLineJoin ) +bool WinSalGraphics::drawPolyLine( + const basegfx::B2DPolygon& rPolygon, + double fTransparency, + const basegfx::B2DVector& rLineWidths, + basegfx::B2DLineJoin eLineJoin, + com::sun::star::drawing::LineCap eLineCap) { const sal_uInt32 nCount(rPolygon.count()); @@ -230,6 +235,27 @@ bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double f } } + switch(eLineCap) + { + default: /*com::sun::star::drawing::LineCap_BUTT*/ + { + // nothing to do + break; + } + case com::sun::star::drawing::LineCap_ROUND: + { + aTestPen.SetStartCap(Gdiplus::LineCapRound); + aTestPen.SetEndCap(Gdiplus::LineCapRound); + break; + } + case com::sun::star::drawing::LineCap_SQUARE: + { + aTestPen.SetStartCap(Gdiplus::LineCapSquare); + aTestPen.SetEndCap(Gdiplus::LineCapSquare); + break; + } + } + if(nCount > 250 && basegfx::fTools::more(rLineWidths.getX(), 1.5)) { impAddB2DPolygonToGDIPlusGraphicsPathInteger(aPath, rPolygon, bNoLineJoin); -- cgit