From 70d5e94706c772944411e12e13082b531ed2185e Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 27 Feb 2014 14:25:45 +0100 Subject: Don't overwrite SPItemCtx in SPRoot::update. (Maybe should be made const everywhere?) (bzr r13065) --- src/sp-root.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/sp-root.cpp') diff --git a/src/sp-root.cpp b/src/sp-root.cpp index bc870b116..4f1444e31 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -221,7 +221,7 @@ void SPRoot::remove_child(Inkscape::XML::Node *child) void SPRoot::update(SPCtx *ctx, guint flags) { - SPItemCtx *ictx = (SPItemCtx *) ctx; + SPItemCtx const *ictx = (SPItemCtx const *) ctx; if( !this->parent ) { @@ -288,10 +288,17 @@ void SPRoot::update(SPCtx *ctx, guint flags) this->height.computed = this->height.value * ictx->viewport.height(); } + // std::cout << "SPRoot::update: final:" + // << " x: " << x.computed + // << " y: " << y.computed + // << " width: " << width.computed + // << " height: " << height.computed << std::endl; + // Calculate new viewport - ictx->viewport = Geom::Rect::from_xywh( this->x.computed, this->y.computed, - this->width.computed, this->height.computed ); - SPItemCtx rctx = get_rctx( ictx ); + SPItemCtx rctx = *ictx; + rctx.viewport = Geom::Rect::from_xywh( this->x.computed, this->y.computed, + this->width.computed, this->height.computed ); + rctx = get_rctx( &rctx ); /* And invoke parent method */ SPGroup::update((SPCtx *) &rctx, flags); -- cgit v1.2.3