diff options
| author | Shlomi Fish <shlomif@shlomifish.org> | 2017-10-05 13:03:19 +0000 |
|---|---|---|
| committer | Shlomi Fish <shlomif@shlomifish.org> | 2017-10-05 13:03:19 +0000 |
| commit | f7f5f977b7b7107eaf719bb27dd68b43e7b011a2 (patch) | |
| tree | 3098543484bbf92309503c77d950855437ef484b /src/sp-root.cpp | |
| parent | Merge double assignment + eliminate trail space. (diff) | |
| download | inkscape-f7f5f977b7b7107eaf719bb27dd68b43e7b011a2.tar.gz inkscape-f7f5f977b7b7107eaf719bb27dd68b43e7b011a2.zip | |
Extract unset_x_and_y().
Diffstat (limited to 'src/sp-root.cpp')
| -rw-r--r-- | src/sp-root.cpp | 12 |
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 |
