summaryrefslogtreecommitdiff
path: root/svgio/source/svgreader/svgpatternnode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/source/svgreader/svgpatternnode.cxx')
-rw-r--r--svgio/source/svgreader/svgpatternnode.cxx90
1 files changed, 45 insertions, 45 deletions
diff --git a/svgio/source/svgreader/svgpatternnode.cxx b/svgio/source/svgreader/svgpatternnode.cxx
index 0096f7ae5772..bb2317bc7d6f 100644
--- a/svgio/source/svgreader/svgpatternnode.cxx
+++ b/svgio/source/svgreader/svgpatternnode.cxx
@@ -198,63 +198,63 @@ namespace svgio
double fTargetWidth(rGeoRange.getWidth());
double fTargetHeight(rGeoRange.getHeight());
- if(fTargetWidth > 0.0 && fTargetHeight > 0.0)
- {
- const SvgUnits aPatternUnits(getPatternUnits() ? *getPatternUnits() : objectBoundingBox);
+ if(!(fTargetWidth > 0.0 && fTargetHeight > 0.0))
+ return;
- if(objectBoundingBox == aPatternUnits)
- {
- rfW = (getWidth().isSet()) ? getWidth().getNumber() : 0.0;
- rfH = (getHeight().isSet()) ? getHeight().getNumber() : 0.0;
+ const SvgUnits aPatternUnits(getPatternUnits() ? *getPatternUnits() : objectBoundingBox);
- if(Unit_percent == getWidth().getUnit())
- {
- rfW *= 0.01;
- }
+ if(objectBoundingBox == aPatternUnits)
+ {
+ rfW = (getWidth().isSet()) ? getWidth().getNumber() : 0.0;
+ rfH = (getHeight().isSet()) ? getHeight().getNumber() : 0.0;
- if(Unit_percent == getHeight().getUnit())
- {
- rfH *= 0.01;
- }
- }
- else
+ if(Unit_percent == getWidth().getUnit())
{
- rfW = (getWidth().isSet()) ? getWidth().solve(rUser, xcoordinate) : 0.0;
- rfH = (getHeight().isSet()) ? getHeight().solve(rUser, ycoordinate) : 0.0;
-
- // make relative to rGeoRange
- rfW /= fTargetWidth;
- rfH /= fTargetHeight;
+ rfW *= 0.01;
}
- if(rfW > 0.0 && rfH > 0.0)
+ if(Unit_percent == getHeight().getUnit())
{
- if(objectBoundingBox == aPatternUnits)
- {
- rfX = (getX().isSet()) ? getX().getNumber() : 0.0;
- rfY = (getY().isSet()) ? getY().getNumber() : 0.0;
+ rfH *= 0.01;
+ }
+ }
+ else
+ {
+ rfW = (getWidth().isSet()) ? getWidth().solve(rUser, xcoordinate) : 0.0;
+ rfH = (getHeight().isSet()) ? getHeight().solve(rUser, ycoordinate) : 0.0;
- if(Unit_percent == getX().getUnit())
- {
- rfX *= 0.01;
- }
+ // make relative to rGeoRange
+ rfW /= fTargetWidth;
+ rfH /= fTargetHeight;
+ }
- if(Unit_percent == getY().getUnit())
- {
- rfY *= 0.01;
- }
- }
- else
- {
- rfX = (getX().isSet()) ? getX().solve(rUser, xcoordinate) : 0.0;
- rfY = (getY().isSet()) ? getY().solve(rUser, ycoordinate) : 0.0;
+ if(!(rfW > 0.0 && rfH > 0.0))
+ return;
- // make relative to rGeoRange
- rfX = (rfX - rGeoRange.getMinX()) / fTargetWidth;
- rfY = (rfY - rGeoRange.getMinY()) / fTargetHeight;
- }
+ if(objectBoundingBox == aPatternUnits)
+ {
+ rfX = (getX().isSet()) ? getX().getNumber() : 0.0;
+ rfY = (getY().isSet()) ? getY().getNumber() : 0.0;
+
+ if(Unit_percent == getX().getUnit())
+ {
+ rfX *= 0.01;
+ }
+
+ if(Unit_percent == getY().getUnit())
+ {
+ rfY *= 0.01;
}
}
+ else
+ {
+ rfX = (getX().isSet()) ? getX().solve(rUser, xcoordinate) : 0.0;
+ rfY = (getY().isSet()) ? getY().solve(rUser, ycoordinate) : 0.0;
+
+ // make relative to rGeoRange
+ rfX = (rfX - rGeoRange.getMinX()) / fTargetWidth;
+ rfY = (rfY - rGeoRange.getMinY()) / fTargetHeight;
+ }
}
const drawinglayer::primitive2d::Primitive2DContainer& SvgPatternNode::getPatternPrimitives() const