diff options
author | Armin Le Grand <alg@apache.org> | 2013-07-15 14:22:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-16 12:47:23 +0100 |
commit | 07ec224acd694e2bae34df818fde6b952bf03e8f (patch) | |
tree | aa607ef05cc3ab1abe6d84911f2351dbe03e88cb /svgio | |
parent | 52bce8fadde39e32c0008babadc2c22cc501f753 (diff) |
Resolves: #i122724# Better handling of line-only paths
(cherry picked from commit 1898f94578f266de42f92602a36518fb12bacf5a)
Change-Id: I3033197e7c59a829c012b84c1d4cbaca7d155d2a
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/source/svgreader/svgstyleattributes.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index d9e99e5279df..511872ec7f1e 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -988,12 +988,9 @@ namespace svgio const basegfx::B2DPolyPolygon& rPath, drawinglayer::primitive2d::Primitive2DSequence& rTarget) const { - const bool bIsLine(1 == rPath.count() - && !rPath.areControlPointsUsed() - && 2 == rPath.getB2DPolygon(0).count()); - if(!rPath.count()) { + // no geometry at all return; } @@ -1001,13 +998,7 @@ namespace svgio if(aGeoRange.isEmpty()) { - return; - } - - if(!bIsLine && // not for lines - (basegfx::fTools::equalZero(aGeoRange.getWidth()) - || basegfx::fTools::equalZero(aGeoRange.getHeight()))) - { + // no geometry range return; } @@ -1015,11 +1006,21 @@ namespace svgio if(basegfx::fTools::equalZero(fOpacity)) { + // not visible return; } + // check if it's a line + const bool bNoWidth(basegfx::fTools::equalZero(aGeoRange.getWidth())); + const bool bNoHeight(basegfx::fTools::equalZero(aGeoRange.getHeight())); + const bool bIsTwoPointLine(1 == rPath.count() + && !rPath.areControlPointsUsed() + && 2 == rPath.getB2DPolygon(0).count()); + const bool bIsLine(bIsTwoPointLine || bNoWidth || bNoHeight); + if(!bIsLine) { + // create fill basegfx::B2DPolyPolygon aPath(rPath); const bool bNeedToCheckClipRule(SVGTokenPath == mrOwner.getType() || SVGTokenPolygon == mrOwner.getType()); const bool bClipPathIsNonzero(!bIsLine && bNeedToCheckClipRule && mbIsClipPathContent && FillRule_nonzero == maClipRule); @@ -1034,6 +1035,7 @@ namespace svgio add_fill(aPath, rTarget, aGeoRange); } + // create stroke add_stroke(rPath, rTarget, aGeoRange); // Svg supports markers for path, polygon, polyline and line |