From 24526cceccb4ed103a6324756476c64efb3fb5dd Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 16:58:22 +0200 Subject: Remove all NRRect use. (bzr r10582.1.5) --- src/sp-use.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/sp-use.cpp') diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 057c01ef1..04cf1eb2c 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -594,21 +594,18 @@ sp_use_update(SPObject *object, SPCtx *ctx, unsigned flags) /* Set up child viewport */ if (use->x.unit == SVGLength::PERCENT) { - use->x.computed = use->x.value * (ictx->vp.x1 - ictx->vp.x0); + use->x.computed = use->x.value * ictx->viewport.width(); } if (use->y.unit == SVGLength::PERCENT) { - use->y.computed = use->y.value * (ictx->vp.y1 - ictx->vp.y0); + use->y.computed = use->y.value * ictx->viewport.height(); } if (use->width.unit == SVGLength::PERCENT) { - use->width.computed = use->width.value * (ictx->vp.x1 - ictx->vp.x0); + use->width.computed = use->width.value * ictx->viewport.width(); } if (use->height.unit == SVGLength::PERCENT) { - use->height.computed = use->height.value * (ictx->vp.y1 - ictx->vp.y0); + use->height.computed = use->height.value * ictx->viewport.height(); } - cctx.vp.x0 = 0.0; - cctx.vp.y0 = 0.0; - cctx.vp.x1 = use->width.computed; - cctx.vp.y1 = use->height.computed; + cctx.viewport = Geom::Rect::from_xywh(0, 0, use->width.computed, use->height.computed); cctx.i2vp = Geom::identity(); flags&=~SP_OBJECT_USER_MODIFIED_FLAG_B; -- cgit v1.2.3