From a4ba7249e4e4510665860eebb43262b0ec7612b0 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 25 Jun 2016 20:55:14 +0200 Subject: Fix bug#168286 also opem regression on bug#1594565 Fixed bugs: - https://launchpad.net/bugs/168286 (bzr r15002) --- src/sp-item-group.cpp | 104 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 83d67cf5a..70d2bc732 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -53,6 +53,10 @@ #include "layer-model.h" #include "sp-textpath.h" #include "sp-flowtext.h" +#include "sp-tspan.h" +#include "selection-chemistry.h" +#include "xml/sp-css-attr.h" +#include "svg/css-ostringstream.h" using Inkscape::DocumentUndo; @@ -388,6 +392,89 @@ void sp_item_group_ungroup_handle_clones(SPItem *parent, Geom::Affine const g) } } +void +sp_recursive_scale_text_size(Inkscape::XML::Node *repr, double scale){ + for (Inkscape::XML::Node *child = repr->firstChild() ; child; child = child->next() ){ + if ( child) { + sp_recursive_scale_text_size(child, scale); + } + } + SPCSSAttr * css = sp_repr_css_attr(repr,"style"); + Glib::ustring element = g_quark_to_string(repr->code()); + if (css && element == "svg:text" || element == "svg:tspan") { + gchar const *w = sp_repr_css_property(css, "font-size", NULL); + if (w) { + gchar *units = NULL; + double wd = g_ascii_strtod(w, &units); + wd *= scale; + if (w != units) { + Inkscape::CSSOStringStream os; + os << wd << units; // reattach units + sp_repr_css_set_property(css, "font-size", os.str().c_str()); + Glib::ustring css_str; + sp_repr_css_write_string(css,css_str); + repr->setAttribute("style", css_str.c_str()); + } + } + w = NULL; + w = sp_repr_css_property(css, "letter-spacing", NULL); + if (w) { + gchar *units = NULL; + double wd = g_ascii_strtod(w, &units); + wd *= scale; + if (w != units) { + Inkscape::CSSOStringStream os; + os << wd << units; // reattach units + sp_repr_css_set_property(css, "letter-spacing", os.str().c_str()); + Glib::ustring css_str; + sp_repr_css_write_string(css,css_str); + repr->setAttribute("style", css_str.c_str()); + } + } + w = NULL; + w = sp_repr_css_property(css, "word-spacing", NULL); + if (w) { + gchar *units = NULL; + double wd = g_ascii_strtod(w, &units); + wd *= scale; + if (w != units) { + Inkscape::CSSOStringStream os; + os << wd << units; // reattach units + sp_repr_css_set_property(css, "word-spacing", os.str().c_str()); + Glib::ustring css_str; + sp_repr_css_write_string(css,css_str); + repr->setAttribute("style", css_str.c_str()); + } + } + gchar const *dx = repr->attribute("dx"); + if (dx) { + gchar ** dxarray = g_strsplit(dx, " ", 0); + Inkscape::SVGOStringStream dx_data; + while (*dxarray != NULL) { + double pos; + sp_svg_number_read_d(*dxarray, &pos); + pos *= scale; + dx_data << pos << " "; + dxarray++; + } + repr->setAttribute("dx", dx_data.str().c_str()); + } + gchar const *dy = repr->attribute("dy"); + if (dy) { + gchar ** dyarray = g_strsplit(dy, " ", 0); + Inkscape::SVGOStringStream dy_data; + while (*dyarray != NULL) { + double pos; + sp_svg_number_read_d(*dyarray, &pos); + pos *= scale; + dy_data << pos << " "; + dyarray++; + } + repr->setAttribute("dy", dy_data.str().c_str()); + } + } +} + void sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_done) { @@ -492,7 +579,22 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_d // reattached outside of the group, the transform will be written more properly // (i.e. optimized into the object if the corresponding preference is set) gchar *affinestr=sp_svg_transform_write(ctrans); - nrepr->setAttribute("transform", affinestr); + SPText * text = dynamic_cast(citem); + if (text) { + //this causes a change in text-on-path appearance when there is a non-conformal transform, see bug #1594565 + double scale = (ctrans.expansionX() + ctrans.expansionY()) / 2.0; + SPTextPath * text_path = dynamic_cast(text->children); + if (!text_path) { + nrepr->setAttribute("transform", affinestr); + } else { + sp_recursive_scale_text_size(nrepr, scale); + Geom::Affine ttrans = ctrans.inverse() * SP_ITEM(text)->transform * ctrans; + gchar *affinestr = sp_svg_transform_write(ttrans); + nrepr->setAttribute("transform", affinestr); + } + } else { + nrepr->setAttribute("transform", affinestr); + } g_free(affinestr); items = g_slist_prepend (items, nrepr); -- cgit v1.2.3 From 058e95a59ccb2ab1748392acdfdbbffd516c9c81 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Mon, 11 Jul 2016 14:24:52 +0200 Subject: First part of new SPObject children list (bzr r14954.1.17) --- src/sp-item-group.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 70d2bc732..d775e306f 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -297,9 +297,8 @@ Geom::OptRect SPGroup::bbox(Geom::Affine const &transform, SPItem::BBoxType bbox } void SPGroup::print(SPPrintContext *ctx) { - std::vector l=this->childList(false); - for(std::vector::const_iterator i=l.begin();i!=l.end();++i){ - SPObject *o = *i; + for(auto& child: _children){ + SPObject *o = &child; SPItem *item = dynamic_cast(o); if (item) { item->invoke_print(ctx); -- cgit v1.2.3 From d1947e768272c703674129d5c583204ff2b59251 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 13 Jul 2016 13:36:19 +0200 Subject: Second part of new SPObject children list (bzr r14954.1.19) --- src/sp-item-group.cpp | 61 ++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index d775e306f..7915b0453 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -235,9 +235,9 @@ Inkscape::XML::Node* SPGroup::write(Inkscape::XML::Document *xml_doc, Inkscape:: l = NULL; - for (SPObject *child = firstChild(); child; child = child->getNext() ) { - if ( !dynamic_cast(child) && !dynamic_cast(child) ) { - Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags); + for (auto& child: _children) { + if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { + Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags); if (crepr) { l = g_slist_prepend (l, crepr); @@ -251,9 +251,9 @@ Inkscape::XML::Node* SPGroup::write(Inkscape::XML::Document *xml_doc, Inkscape:: l = g_slist_remove (l, l->data); } } else { - for (SPObject *child = firstChild() ; child ; child = child->getNext() ) { - if ( !dynamic_cast(child) && !dynamic_cast(child) ) { - child->updateRepr(flags); + for (auto& child: _children) { + if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { + child.updateRepr(flags); } } } @@ -365,9 +365,9 @@ void SPGroup::hide (unsigned int key) { void SPGroup::snappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) const { - for ( SPObject const *o = this->firstChild(); o; o = o->getNext() ) + for (auto& o: _children) { - SPItem const *item = dynamic_cast(o); + SPItem const *item = dynamic_cast(&o); if (item) { item->getSnappoints(p, snapprefs); } @@ -511,20 +511,21 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_d GSList *objects = NULL; Geom::Affine const g(group->transform); - for (SPObject *child = group->firstChild() ; child; child = child->getNext() ) - if (SPItem *citem = dynamic_cast(child)) - sp_item_group_ungroup_handle_clones(citem,g); - + for (auto& child: group->_children) { + if (SPItem *citem = dynamic_cast(&child)) { + sp_item_group_ungroup_handle_clones(citem, g); + } + } - for (SPObject *child = group->firstChild() ; child; child = child->getNext() ) { - SPItem *citem = dynamic_cast(child); + for (auto& child: group->_children) { + SPItem *citem = dynamic_cast(&child); if (citem) { /* Merging of style */ // this converts the gradient/pattern fill/stroke, if any, to userSpaceOnUse; we need to do // it here _before_ the new transform is set, so as to use the pre-transform bbox citem->adjust_paint_recursive (Geom::identity(), Geom::identity(), false); - child->style->merge( group->style ); + child.style->merge( group->style ); /* * fixme: We currently make no allowance for the case where child is cloned * and the group has any style settings. @@ -546,9 +547,9 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_d * extra complication & maintenance burden and this case is rare. */ - child->updateRepr(); + child.updateRepr(); - Inkscape::XML::Node *nrepr = child->getRepr()->duplicate(prepr->document()); + Inkscape::XML::Node *nrepr = child.getRepr()->duplicate(prepr->document()); // Merging transform Geom::Affine ctrans = citem->transform * g; @@ -599,7 +600,7 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_d items = g_slist_prepend (items, nrepr); } else { - Inkscape::XML::Node *nrepr = child->getRepr()->duplicate(prepr->document()); + Inkscape::XML::Node *nrepr = child.getRepr()->duplicate(prepr->document()); objects = g_slist_prepend (objects, nrepr); } } @@ -661,9 +662,9 @@ std::vector sp_item_group_item_list(SPGroup * group) std::vector s; g_return_val_if_fail(group != NULL, s); - for (SPObject *o = group->firstChild() ; o ; o = o->getNext() ) { - if ( dynamic_cast(o) ) { - s.push_back((SPItem*)o); + for (auto& o: group->_children) { + if ( dynamic_cast(&o) ) { + s.push_back((SPItem*)&o); } } return s; @@ -734,8 +735,8 @@ void SPGroup::_updateLayerMode(unsigned int display_key) { void SPGroup::translateChildItems(Geom::Translate const &tr) { if ( hasChildren() ) { - for (SPObject *o = firstChild() ; o ; o = o->getNext() ) { - SPItem *item = dynamic_cast(o); + for (auto& o: _children) { + SPItem *item = dynamic_cast(&o); if ( item ) { sp_item_move_rel(item, tr); } @@ -747,14 +748,14 @@ void SPGroup::translateChildItems(Geom::Translate const &tr) void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p, bool noRecurse) { if ( hasChildren() ) { - for (SPObject *o = firstChild() ; o ; o = o->getNext() ) { - if ( SPDefs *defs = dynamic_cast(o) ) { // select symbols from defs, ignore clips, masks, patterns - for (SPObject *defschild = defs->firstChild() ; defschild ; defschild = defschild->getNext() ) { - SPGroup *defsgroup = dynamic_cast(defschild); + for (auto& o: _children) { + if ( SPDefs *defs = dynamic_cast(&o) ) { // select symbols from defs, ignore clips, masks, patterns + for (auto& defschild: defs->_children) { + SPGroup *defsgroup = dynamic_cast(&defschild); if (defsgroup) defsgroup->scaleChildItemsRec(sc, p, false); } - } else if ( SPItem *item = dynamic_cast(o) ) { + } else if ( SPItem *item = dynamic_cast(&o) ) { SPGroup *group = dynamic_cast(item); if (group && !dynamic_cast(item)) { /* Using recursion breaks clipping because transforms are applied @@ -870,8 +871,8 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p, bo gint SPGroup::getItemCount() const { gint len = 0; - for (SPObject const *o = this->firstChild() ; o ; o = o->getNext() ) { - if (dynamic_cast(o)) { + for (auto& child: _children) { + if (dynamic_cast(&child)) { len++; } } -- cgit v1.2.3 From 9e210a6d1333c3366681547e3e81593ef69ff73e Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 12:56:49 +0200 Subject: Last part of new SPObject children list (bzr r14954.1.20) --- src/sp-item-group.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 7915b0453..8d482d9b1 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -583,7 +583,7 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_d if (text) { //this causes a change in text-on-path appearance when there is a non-conformal transform, see bug #1594565 double scale = (ctrans.expansionX() + ctrans.expansionY()) / 2.0; - SPTextPath * text_path = dynamic_cast(text->children); + SPTextPath * text_path = dynamic_cast(text->firstChild()); if (!text_path) { nrepr->setAttribute("transform", affinestr); } else { -- cgit v1.2.3 From 24d3f50003ca3cec6a03a7f5267cc4fe5588c69f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 13:17:21 +0200 Subject: Renamed children list in SPObject (bzr r14954.1.21) --- src/sp-item-group.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 8d482d9b1..63edb3c84 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -235,7 +235,7 @@ Inkscape::XML::Node* SPGroup::write(Inkscape::XML::Document *xml_doc, Inkscape:: l = NULL; - for (auto& child: _children) { + for (auto& child: children) { if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags); @@ -251,7 +251,7 @@ Inkscape::XML::Node* SPGroup::write(Inkscape::XML::Document *xml_doc, Inkscape:: l = g_slist_remove (l, l->data); } } else { - for (auto& child: _children) { + for (auto& child: children) { if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { child.updateRepr(flags); } @@ -297,7 +297,7 @@ Geom::OptRect SPGroup::bbox(Geom::Affine const &transform, SPItem::BBoxType bbox } void SPGroup::print(SPPrintContext *ctx) { - for(auto& child: _children){ + for(auto& child: children){ SPObject *o = &child; SPItem *item = dynamic_cast(o); if (item) { @@ -365,7 +365,7 @@ void SPGroup::hide (unsigned int key) { void SPGroup::snappoints(std::vector &p, Inkscape::SnapPreferences const *snapprefs) const { - for (auto& o: _children) + for (auto& o: children) { SPItem const *item = dynamic_cast(&o); if (item) { @@ -511,13 +511,13 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_d GSList *objects = NULL; Geom::Affine const g(group->transform); - for (auto& child: group->_children) { + for (auto& child: group->children) { if (SPItem *citem = dynamic_cast(&child)) { sp_item_group_ungroup_handle_clones(citem, g); } } - for (auto& child: group->_children) { + for (auto& child: group->children) { SPItem *citem = dynamic_cast(&child); if (citem) { /* Merging of style */ @@ -662,7 +662,7 @@ std::vector sp_item_group_item_list(SPGroup * group) std::vector s; g_return_val_if_fail(group != NULL, s); - for (auto& o: group->_children) { + for (auto& o: group->children) { if ( dynamic_cast(&o) ) { s.push_back((SPItem*)&o); } @@ -735,7 +735,7 @@ void SPGroup::_updateLayerMode(unsigned int display_key) { void SPGroup::translateChildItems(Geom::Translate const &tr) { if ( hasChildren() ) { - for (auto& o: _children) { + for (auto& o: children) { SPItem *item = dynamic_cast(&o); if ( item ) { sp_item_move_rel(item, tr); @@ -748,9 +748,9 @@ void SPGroup::translateChildItems(Geom::Translate const &tr) void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p, bool noRecurse) { if ( hasChildren() ) { - for (auto& o: _children) { + for (auto& o: children) { if ( SPDefs *defs = dynamic_cast(&o) ) { // select symbols from defs, ignore clips, masks, patterns - for (auto& defschild: defs->_children) { + for (auto& defschild: defs->children) { SPGroup *defsgroup = dynamic_cast(&defschild); if (defsgroup) defsgroup->scaleChildItemsRec(sc, p, false); @@ -871,7 +871,7 @@ void SPGroup::scaleChildItemsRec(Geom::Scale const &sc, Geom::Point const &p, bo gint SPGroup::getItemCount() const { gint len = 0; - for (auto& child: _children) { + for (auto& child: children) { if (dynamic_cast(&child)) { len++; } -- cgit v1.2.3 From f35bb1f74a0ffeb5c6477a25e3c4cde87a97bcf1 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 12:06:06 +0200 Subject: Removed unused includes, decrease compilation time (bzr r15025) --- src/sp-item-group.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 70d2bc732..f5c8f348e 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -15,7 +15,7 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include #endif #include @@ -32,16 +32,13 @@ #include "attributes.h" #include "sp-item-transform.h" #include "sp-root.h" -#include "sp-use.h" #include "sp-offset.h" #include "sp-clippath.h" #include "sp-mask.h" #include "sp-path.h" #include "box3d.h" #include "persp3d.h" -#include "inkscape.h" -#include "selection.h" #include "live_effects/effect.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" @@ -50,10 +47,8 @@ #include "sp-switch.h" #include "sp-defs.h" #include "verbs.h" -#include "layer-model.h" #include "sp-textpath.h" #include "sp-flowtext.h" -#include "sp-tspan.h" #include "selection-chemistry.h" #include "xml/sp-css-attr.h" #include "svg/css-ostringstream.h" -- cgit v1.2.3 From 43b49e325db73cc19b1731db6c69545664ee8fbe Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 28 Jul 2016 13:26:17 +0200 Subject: Reverted changes to r15024 after many building problems (bzr r15027) --- src/sp-item-group.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index f5c8f348e..70d2bc732 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -15,7 +15,7 @@ */ #ifdef HAVE_CONFIG_H -#include +# include "config.h" #endif #include @@ -32,13 +32,16 @@ #include "attributes.h" #include "sp-item-transform.h" #include "sp-root.h" +#include "sp-use.h" #include "sp-offset.h" #include "sp-clippath.h" #include "sp-mask.h" #include "sp-path.h" #include "box3d.h" #include "persp3d.h" +#include "inkscape.h" +#include "selection.h" #include "live_effects/effect.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" @@ -47,8 +50,10 @@ #include "sp-switch.h" #include "sp-defs.h" #include "verbs.h" +#include "layer-model.h" #include "sp-textpath.h" #include "sp-flowtext.h" +#include "sp-tspan.h" #include "selection-chemistry.h" #include "xml/sp-css-attr.h" #include "svg/css-ostringstream.h" -- cgit v1.2.3 From 35830f456cadaecf8b8e3944e3031a1a93f6cb41 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 3 Aug 2016 15:29:38 +0200 Subject: Removed unused includes, decreased compilation time. Once again (bzr r15034) --- src/sp-item-group.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 70d2bc732..f5c8f348e 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -15,7 +15,7 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +#include #endif #include @@ -32,16 +32,13 @@ #include "attributes.h" #include "sp-item-transform.h" #include "sp-root.h" -#include "sp-use.h" #include "sp-offset.h" #include "sp-clippath.h" #include "sp-mask.h" #include "sp-path.h" #include "box3d.h" #include "persp3d.h" -#include "inkscape.h" -#include "selection.h" #include "live_effects/effect.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" @@ -50,10 +47,8 @@ #include "sp-switch.h" #include "sp-defs.h" #include "verbs.h" -#include "layer-model.h" #include "sp-textpath.h" #include "sp-flowtext.h" -#include "sp-tspan.h" #include "selection-chemistry.h" #include "xml/sp-css-attr.h" #include "svg/css-ostringstream.h" -- cgit v1.2.3 From 88286fa544522728a3d6e4db666ac0402c33795f Mon Sep 17 00:00:00 2001 From: alvinhochun Date: Mon, 29 Aug 2016 08:07:58 +0200 Subject: [Bug #1425542] Filter applied on group does not auto redraw when edited. Fixed bugs: - https://launchpad.net/bugs/1425542 (bzr r15083) --- src/sp-item-group.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 097026057..aeeea5721 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -204,6 +204,13 @@ void SPGroup::modified(guint flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; + if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { + for (SPItemView *v = this->display; v != NULL; v = v->next) { + Inkscape::DrawingGroup *group = dynamic_cast(v->arenaitem); + group->setStyle(this->style); + } + } + std::vector l=this->childList(true); for(std::vector::const_iterator i=l.begin();i!=l.end();++i){ SPObject *child = *i; -- cgit v1.2.3 From 7e353bc36b7c8ceaf1894aecab65b5c93217e870 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 29 Aug 2016 08:21:22 +0200 Subject: Code design. Replacing tabs with spaces, and fixng parentheses warning. (bzr r15084) --- src/sp-item-group.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index aeeea5721..96dcdbe30 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -132,7 +132,7 @@ void SPGroup::remove_child(Inkscape::XML::Node *child) { void SPGroup::order_changed (Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref) { - SPLPEItem::order_changed(child, old_ref, new_ref); + SPLPEItem::order_changed(child, old_ref, new_ref); SPItem *item = dynamic_cast(get_child_by_repr(child)); if ( item ) { @@ -199,7 +199,7 @@ void SPGroup::modified(guint flags) { // std::cout << "SPGroup::modified(): " << (getId()?getId():"null") << std::endl; SPLPEItem::modified(flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { - flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; + flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } flags &= SP_OBJECT_MODIFIED_CASCADE; @@ -352,7 +352,7 @@ Inkscape::DrawingItem *SPGroup::show (Inkscape::Drawing &drawing, unsigned int k } void SPGroup::hide (unsigned int key) { - std::vector l=this->childList(false, SPObject::ActionShow); + std::vector l=this->childList(false, SPObject::ActionShow); for(std::vector::const_iterator i=l.begin();i!=l.end();++i){ SPObject *o = *i; @@ -402,7 +402,7 @@ sp_recursive_scale_text_size(Inkscape::XML::Node *repr, double scale){ } SPCSSAttr * css = sp_repr_css_attr(repr,"style"); Glib::ustring element = g_quark_to_string(repr->code()); - if (css && element == "svg:text" || element == "svg:tspan") { + if ((css && element == "svg:text") || element == "svg:tspan") { gchar const *w = sp_repr_css_property(css, "font-size", NULL); if (w) { gchar *units = NULL; -- cgit v1.2.3 From f63c3282a4eceddf5d0e585980c6d7369cb22c1b Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 15 Dec 2016 12:26:38 +0100 Subject: Fixes for internal document scaling and add a second test option. (bzr r15325) --- src/sp-item-group.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/sp-item-group.cpp') diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 96dcdbe30..7b2507b5e 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -584,12 +584,13 @@ sp_item_group_ungroup (SPGroup *group, std::vector &children, bool do_d SPText * text = dynamic_cast(citem); if (text) { //this causes a change in text-on-path appearance when there is a non-conformal transform, see bug #1594565 - double scale = (ctrans.expansionX() + ctrans.expansionY()) / 2.0; SPTextPath * text_path = dynamic_cast(text->firstChild()); if (!text_path) { nrepr->setAttribute("transform", affinestr); } else { - sp_recursive_scale_text_size(nrepr, scale); + // The following breaks roundtripping group -> ungroup + // double scale = (ctrans.expansionX() + ctrans.expansionY()) / 2.0; + // sp_recursive_scale_text_size(nrepr, scale); Geom::Affine ttrans = ctrans.inverse() * SP_ITEM(text)->transform * ctrans; gchar *affinestr = sp_svg_transform_write(ttrans); nrepr->setAttribute("transform", affinestr); -- cgit v1.2.3