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 From fa0d3b889ad80af4b5a0c3f58226978a42e96b37 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 28 Feb 2014 15:01:45 +0100 Subject: Properly identify an embedded SVG. (bzr r13075) --- src/sp-root.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/sp-root.cpp') diff --git a/src/sp-root.cpp b/src/sp-root.cpp index 4f1444e31..12570e03e 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -387,6 +387,9 @@ void SPRoot::print(SPPrintContext *ctx) sp_print_release(ctx); } +const char *SPRoot::displayName() const { + return "SVG"; // Do not translate +} /* Local Variables: -- cgit v1.2.3