summaryrefslogtreecommitdiff
path: root/svgio/source/svgreader/svgrectnode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/source/svgreader/svgrectnode.cxx')
-rw-r--r--svgio/source/svgreader/svgrectnode.cxx82
1 files changed, 41 insertions, 41 deletions
diff --git a/svgio/source/svgreader/svgrectnode.cxx b/svgio/source/svgreader/svgrectnode.cxx
index c0ff40925f2d..d8c9ce6afb91 100644
--- a/svgio/source/svgreader/svgrectnode.cxx
+++ b/svgio/source/svgreader/svgrectnode.cxx
@@ -158,57 +158,57 @@ namespace svgio
// get size range and create path
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
- if(pStyle && getWidth().isSet() && getHeight().isSet())
- {
- const double fWidth(getWidth().solve(*this, xcoordinate));
- const double fHeight(getHeight().solve(*this, ycoordinate));
+ if(!(pStyle && getWidth().isSet() && getHeight().isSet()))
+ return;
- if(fWidth > 0.0 && fHeight > 0.0)
- {
- const double fX(getX().isSet() ? getX().solve(*this, xcoordinate) : 0.0);
- const double fY(getY().isSet() ? getY().solve(*this, ycoordinate) : 0.0);
- const basegfx::B2DRange aRange(fX, fY, fX + fWidth, fY + fHeight);
- basegfx::B2DPolygon aPath;
+ const double fWidth(getWidth().solve(*this, xcoordinate));
+ const double fHeight(getHeight().solve(*this, ycoordinate));
- if(getRx().isSet() || getRy().isSet())
- {
- double frX(getRx().isSet() ? getRx().solve(*this, xcoordinate) : 0.0);
- double frY(getRy().isSet() ? getRy().solve(*this, ycoordinate) : 0.0);
+ if(!(fWidth > 0.0 && fHeight > 0.0))
+ return;
- frX = std::max(0.0, frX);
- frY = std::max(0.0, frY);
+ const double fX(getX().isSet() ? getX().solve(*this, xcoordinate) : 0.0);
+ const double fY(getY().isSet() ? getY().solve(*this, ycoordinate) : 0.0);
+ const basegfx::B2DRange aRange(fX, fY, fX + fWidth, fY + fHeight);
+ basegfx::B2DPolygon aPath;
- if(0.0 == frY && frX > 0.0)
- {
- frY = frX;
- }
- else if(0.0 == frX && frY > 0.0)
- {
- frX = frY;
- }
+ if(getRx().isSet() || getRy().isSet())
+ {
+ double frX(getRx().isSet() ? getRx().solve(*this, xcoordinate) : 0.0);
+ double frY(getRy().isSet() ? getRy().solve(*this, ycoordinate) : 0.0);
+
+ frX = std::max(0.0, frX);
+ frY = std::max(0.0, frY);
+
+ if(0.0 == frY && frX > 0.0)
+ {
+ frY = frX;
+ }
+ else if(0.0 == frX && frY > 0.0)
+ {
+ frX = frY;
+ }
- frX /= fWidth;
- frY /= fHeight;
+ frX /= fWidth;
+ frY /= fHeight;
- frX = std::min(0.5, frX);
- frY = std::min(0.5, frY);
+ frX = std::min(0.5, frX);
+ frY = std::min(0.5, frY);
- aPath = basegfx::utils::createPolygonFromRect(aRange, frX * 2.0, frY * 2.0);
- }
- else
- {
- aPath = basegfx::utils::createPolygonFromRect(aRange);
- }
+ aPath = basegfx::utils::createPolygonFromRect(aRange, frX * 2.0, frY * 2.0);
+ }
+ else
+ {
+ aPath = basegfx::utils::createPolygonFromRect(aRange);
+ }
- drawinglayer::primitive2d::Primitive2DContainer aNewTarget;
+ drawinglayer::primitive2d::Primitive2DContainer aNewTarget;
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, nullptr);
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, nullptr);
- if(!aNewTarget.empty())
- {
- pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
- }
- }
+ if(!aNewTarget.empty())
+ {
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
}
}
} // end of namespace svgreader