diff options
| author | Shlomi Fish <shlomif@shlomifish.org> | 2017-10-05 14:56:20 +0000 |
|---|---|---|
| committer | Shlomi Fish <shlomif@shlomifish.org> | 2017-10-05 14:56:20 +0000 |
| commit | 01abd8ec977b4caae888b7e315c6c18ced52e74c (patch) | |
| tree | e4284c4b77cede6f1ac7e20236bdc916dd8b5e44 /src/sp-use.cpp | |
| parent | Extract a base class, SPDimensions. (diff) | |
| download | inkscape-01abd8ec977b4caae888b7e315c6c18ced52e74c.tar.gz inkscape-01abd8ec977b4caae888b7e315c6c18ced52e74c.zip | |
Extract SPDimensions from spuse
Diffstat (limited to 'src/sp-use.cpp')
| -rw-r--r-- | src/sp-use.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/sp-use.cpp b/src/sp-use.cpp index fae442cfa..61e8002bb 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -43,11 +43,8 @@ SPUse::SPUse() : SPItem(), + SPDimensions(), child(NULL), - x(), - y(), - width(), - height(), href(NULL), ref(new SPUseReference(this)), _delete_connection(), @@ -581,21 +578,7 @@ void SPUse::update(SPCtx *ctx, unsigned flags) { childflags &= SP_OBJECT_MODIFIED_CASCADE; /* Set up child viewport */ - if (this->x.unit == SVGLength::PERCENT) { - this->x.computed = this->x.value * ictx->viewport.width(); - } - - if (this->y.unit == SVGLength::PERCENT) { - this->y.computed = this->y.value * ictx->viewport.height(); - } - - if (this->width.unit == SVGLength::PERCENT) { - this->width.computed = this->width.value * ictx->viewport.width(); - } - - if (this->height.unit == SVGLength::PERCENT) { - this->height.computed = this->height.value * ictx->viewport.height(); - } + this->calcDimsFromParentViewport(ictx); childflags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; |
