summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2019-10-31 20:26:44 +0100
committerLuboš Luňák <l.lunak@collabora.com>2019-11-26 13:24:53 +0100
commit0d2e258c9e088ef4eaebceb5a6a5b218b7d15d1a (patch)
treec28d05c83e722de176c2b9010d66592ddac38276
parentbackendtest: test blending of bitmap (diff)
downloadcore-0d2e258c9e088ef4eaebceb5a6a5b218b7d15d1a.tar.gz
core-0d2e258c9e088ef4eaebceb5a6a5b218b7d15d1a.zip
skia: don't loop to first point if the polygon is not closed
This fixes drawing of non-closed polylines. Without this fix the non-closed polylines an extra step is still drawn from the last point in the polygon to the first one (as if the polyline would be closed). Change-Id: I0171aede3dc03f83b7dd8ae699e6b505b3fd4f7f
-rw-r--r--vcl/skia/gdiimpl.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index b375b39d1c28..a406d85e924d 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -59,6 +59,10 @@ void lclPolygonToPath(const basegfx::B2DPolygon& rPolygon, SkPath& rPath)
for (sal_uInt32 nIndex = 0; nIndex <= nPointCount; nIndex++)
{
+ if (nIndex == nPointCount && !bClosePath)
+ continue;
+
+ // Make sure we loop the last point to first point
nCurrentIndex = nIndex % nPointCount;
aCurrentPoint = rPolygon.getB2DPoint(nCurrentIndex);