From f7f5f977b7b7107eaf719bb27dd68b43e7b011a2 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 5 Oct 2017 16:03:19 +0300 Subject: Extract unset_x_and_y(). --- src/sp-root.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/sp-root.cpp') 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 -- cgit v1.2.3