tdf#98119 Allow markers on zero-length lines
Inkscape, Seamonkey, Chrome and Batik show markers on zero-
length lines, LibreOffice should do that too. The patch
removes the restriction start<>end.
Change-Id: I984baf755df7b2689e00d2a23b40e3f059c0add0
Reviewed-on: https://gerrit.libreoffice.org/22740
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
diff --git a/svgio/source/svgreader/svglinenode.cxx b/svgio/source/svgreader/svglinenode.cxx
index 6d18480..b63fd8f 100644
--- a/svgio/source/svgreader/svglinenode.cxx
+++ b/svgio/source/svgreader/svglinenode.cxx
@@ -134,21 +134,21 @@ namespace svgio
getX2().isSet() ? getX2().solve(*this, xcoordinate) : 0.0,
getY2().isSet() ? getY2().solve(*this, ycoordinate) : 0.0);
if(!X.equal(Y))
// X and Y may be equal, do not drop them. Markers or linecaps 'round' and 'square'
// need to be drawn for zero-length lines too.
basegfx::B2DPolygon aPath;
aPath.append(X);
aPath.append(Y);
drawinglayer::primitive2d::Primitive2DContainer aNewTarget;
pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, nullptr);
if(!aNewTarget.empty())
{
basegfx::B2DPolygon aPath;
aPath.append(X);
aPath.append(Y);
drawinglayer::primitive2d::Primitive2DContainer aNewTarget;
pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, nullptr);
if(!aNewTarget.empty())
{
pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
}
pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
}
}
}