From 962b4e5a31b1128cdb9dfcccac87e7449a3351f1 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Fri, 25 Jul 2014 17:23:13 -0400 Subject: refresh text objects when clipping (Bug 1339305) Fixed bugs: - https://launchpad.net/bugs/1339305 (bzr r13470) --- src/sp-flowregion.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 709e9e464..e8e5c3d95 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -185,6 +185,8 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc SPItem::write(xml_doc, repr, flags); + this->UpdateComputed(); // copied from update(), see LP Bug 1339305 + return repr; } @@ -372,6 +374,8 @@ static void GetDest(SPObject* child,Shape **computed) tr_mat = SP_ITEM(u_child)->transform; } if ( SP_IS_SHAPE (u_child) ) { + if (!(SP_SHAPE(u_child)->_curve)) + SP_SHAPE (u_child)->set_shape (); curve = SP_SHAPE (u_child)->getCurve (); } else if ( SP_IS_TEXT (u_child) ) { curve = SP_TEXT (u_child)->getNormalizedBpath (); -- cgit v1.2.3 From 653be18705548ae8ab5a0358ecf77feca1b22e54 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 28 Jul 2014 21:34:56 +0200 Subject: noop: remove commented-out code that is dangerous and should not come back (bzr r13475) --- src/sp-flowregion.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index e8e5c3d95..32d3b0f60 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -42,15 +42,12 @@ static void GetDest(SPObject* child,Shape **computed); SPFlowregion::SPFlowregion() : SPItem() { - //new (&this->computed) std::vector; } SPFlowregion::~SPFlowregion() { for (std::vector::iterator it = this->computed.begin() ; it != this->computed.end() ; ++it) { delete *it; } - - //this->computed.~vector(); } void SPFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { -- cgit v1.2.3 From e179290f049d5c34ae2b9c05fdfeab830b7c39e7 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Mon, 10 Nov 2014 09:39:33 -0800 Subject: Removed SP_USE/SP_IS_USE Gtk-ish macros and cleaned affected files. (bzr r13700) --- src/sp-flowregion.cpp | 62 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 24 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 32d3b0f60..580945d74 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -85,12 +85,14 @@ void SPFlowregion::update(SPCtx *ctx, unsigned int flags) { l = g_slist_reverse(l); while (l) { - SPObject *child = SP_OBJECT(l->data); + SPObject *child = reinterpret_cast(l->data); + g_assert(child != NULL); l = g_slist_remove(l, child); + SPItem *item = dynamic_cast(child); if (childflags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { - if (SP_IS_ITEM (child)) { - SPItem const &chi = *SP_ITEM(child); + if (item) { + SPItem const &chi = *item; cctx.i2doc = chi.transform * ictx->i2doc; cctx.i2vp = chi.transform * ictx->i2vp; child->updateDisplay((SPCtx *)&cctx, childflags); @@ -138,7 +140,8 @@ void SPFlowregion::modified(guint flags) { l = g_slist_reverse(l); while (l) { - SPObject *child = SP_OBJECT(l->data); + SPObject *child = reinterpret_cast(l->data); + g_assert(child != NULL); l = g_slist_remove(l, child); if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { @@ -157,7 +160,7 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc GSList *l = NULL; for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) { - if ( !SP_IS_TITLE(child) && !SP_IS_DESC(child) ) { + if ( !dynamic_cast(child) && !dynamic_cast(child) ) { Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags); if (crepr) { @@ -174,7 +177,7 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc } else { for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) { - if ( !SP_IS_TITLE(child) && !SP_IS_DESC(child) ) { + if ( !dynamic_cast(child) && !dynamic_cast(child) ) { child->updateRepr(flags); } } @@ -240,12 +243,14 @@ void SPFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { l = g_slist_reverse (l); while (l) { - SPObject *child = SP_OBJECT(l->data); + SPObject *child = reinterpret_cast(l->data); + g_assert(child != NULL); l = g_slist_remove(l, child); if (flags || (child->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { - if (SP_IS_ITEM (child)) { - SPItem const &chi = *SP_ITEM(child); + SPItem *item = dynamic_cast(child); + if (item) { + SPItem const &chi = *item; cctx.i2doc = chi.transform * ictx->i2doc; cctx.i2vp = chi.transform * ictx->i2vp; child->updateDisplay((SPCtx *)&cctx, flags); @@ -290,7 +295,8 @@ void SPFlowregionExclude::modified(guint flags) { l = g_slist_reverse (l); while (l) { - SPObject *child = SP_OBJECT(l->data); + SPObject *child = reinterpret_cast(l->data); + g_assert(child != NULL); l = g_slist_remove(l, child); if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { @@ -363,20 +369,28 @@ static void GetDest(SPObject* child,Shape **computed) SPCurve *curve=NULL; Geom::Affine tr_mat; - SPObject* u_child=child; - if ( SP_IS_USE(u_child) ) { - u_child=SP_USE(u_child)->child; - tr_mat = SP_ITEM(u_child)->getRelativeTransform(child->parent); - } else { - tr_mat = SP_ITEM(u_child)->transform; - } - if ( SP_IS_SHAPE (u_child) ) { - if (!(SP_SHAPE(u_child)->_curve)) - SP_SHAPE (u_child)->set_shape (); - curve = SP_SHAPE (u_child)->getCurve (); - } else if ( SP_IS_TEXT (u_child) ) { - curve = SP_TEXT (u_child)->getNormalizedBpath (); - } + SPObject* u_child = child; + SPItem *item = dynamic_cast(u_child); + g_assert(item != NULL); + SPUse *use = dynamic_cast(item); + if ( use ) { + u_child = use->child; + tr_mat = use->getRelativeTransform(child->parent); + } else { + tr_mat = item->transform; + } + SPShape *shape = dynamic_cast(u_child); + if ( shape ) { + if (!(shape->_curve)) { + shape->set_shape(); + } + curve = shape->getCurve(); + } else { + SPText *text = dynamic_cast(u_child); + if ( text ) { + curve = text->getNormalizedBpath(); + } + } if ( curve ) { Path* temp=new Path; -- cgit v1.2.3