summaryrefslogtreecommitdiffstats
path: root/src/sp-root.cpp
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@shlomifish.org>2017-10-05 13:03:19 +0000
committerShlomi Fish <shlomif@shlomifish.org>2017-10-05 13:03:19 +0000
commitf7f5f977b7b7107eaf719bb27dd68b43e7b011a2 (patch)
tree3098543484bbf92309503c77d950855437ef484b /src/sp-root.cpp
parentMerge double assignment + eliminate trail space. (diff)
downloadinkscape-f7f5f977b7b7107eaf719bb27dd68b43e7b011a2.tar.gz
inkscape-f7f5f977b7b7107eaf719bb27dd68b43e7b011a2.zip
Extract unset_x_and_y().
Diffstat (limited to 'src/sp-root.cpp')
-rw-r--r--src/sp-root.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index f5e0a7eb9..fc35e26e9 100644
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
@@ -40,8 +40,7 @@ SPRoot::SPRoot() : SPGroup(), SPViewBox()
this->version.inkscape = zero_version;
this->original.inkscape = zero_version;
- this->x.unset(SVGLength::PERCENT, 0.0, 0.0); // Ignored for root SVG element
- this->y.unset(SVGLength::PERCENT, 0.0, 0.0);
+ this->unset_x_and_y();
this->width.unset(SVGLength::PERCENT, 1.0, 1.0);
this->height.unset(SVGLength::PERCENT, 1.0, 1.0);
@@ -52,6 +51,12 @@ SPRoot::~SPRoot()
{
}
+void SPRoot::unset_x_and_y()
+{
+ this->x.unset(SVGLength::PERCENT, 0.0, 0.0); // Ignored for root SVG element
+ this->y.unset(SVGLength::PERCENT, 0.0, 0.0);
+}
+
void SPRoot::build(SPDocument *document, Inkscape::XML::Node *repr)
{
//XML Tree being used directly here while it shouldn't be.
@@ -254,8 +259,7 @@ void SPRoot::update(SPCtx *ctx, guint flags)
}
// Ignore x, y values for root element
- this->x.unset(SVGLength::PERCENT, 0.0, 0.0);
- this->y.unset(SVGLength::PERCENT, 0.0, 0.0);
+ this->unset_x_and_y();
}
// Calculate x, y, width, height from parent/initial viewport