diff options
| author | Jabiertxof <jtx@jtx> | 2016-12-08 02:08:15 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx> | 2016-12-08 02:08:15 +0000 |
| commit | 29ce4ffa9e5e7ba3baf08a43e5848c0bc8038149 (patch) | |
| tree | 3b51f70f9b467bb016c678afcaae650e3afd395b /src | |
| parent | Update to trunk (diff) | |
| download | inkscape-29ce4ffa9e5e7ba3baf08a43e5848c0bc8038149.tar.gz inkscape-29ce4ffa9e5e7ba3baf08a43e5848c0bc8038149.zip | |
Noumerous bugfixes
(bzr r15295.1.18)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-measure-line.cpp | 16 | ||||
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.cpp | 20 |
2 files changed, 25 insertions, 11 deletions
diff --git a/src/live_effects/lpe-measure-line.cpp b/src/live_effects/lpe-measure-line.cpp index ef63888d9..8847b78aa 100644 --- a/src/live_effects/lpe-measure-line.cpp +++ b/src/live_effects/lpe-measure-line.cpp @@ -24,6 +24,7 @@ #include "svg/svg.h" #include "display/curve.h" #include "2geom/affine.h" +#include "path-chemistry.h" #include "style.h" #include "sp-root.h" #include "sp-defs.h" @@ -720,12 +721,19 @@ LPEMeasureLine::processObjects(LpeAction lpe_action) SVGElemRef->attach(SVGElem_uri); SPObject *elemref = NULL; if (elemref = SVGElemRef->getObject()) { + Inkscape::XML::Node * elemnode = elemref->getRepr(); + std::vector<SPItem*> item_list; + item_list.push_back(SP_ITEM(elemref)); + std::vector<Inkscape::XML::Node*> item_to_select; + std::vector<SPItem*> item_selected; SPCSSAttr *css; Glib::ustring css_str; switch (lpe_action){ case LPE_TO_OBJECTS: - elemref->getRepr()->setAttribute("inkscape:path-effect", NULL); - elemref->getRepr()->setAttribute("sodipodi:insensitive", NULL); + if (elemnode->attribute("inkscape:path-effect")) { + sp_item_list_to_curves(item_list, item_selected, item_to_select); + } + elemnode->setAttribute("sodipodi:insensitive", NULL); break; case LPE_ERASE: @@ -743,7 +751,7 @@ LPEMeasureLine::processObjects(LpeAction lpe_action) css->setAttribute("display", NULL); } sp_repr_css_write_string(css,css_str); - elemref->getRepr()->setAttribute("style", css_str.c_str()); + elemnode->setAttribute("style", css_str.c_str()); break; default: @@ -751,7 +759,7 @@ LPEMeasureLine::processObjects(LpeAction lpe_action) } } } - if (lpe_action == LPE_ERASE) { + if (lpe_action == LPE_ERASE || lpe_action == LPE_TO_OBJECTS) { elements.clear(); } } diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index a338f60f4..11620b23f 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -23,6 +23,7 @@ #include "2geom/affine.h" #include "uri.h" #include "uri-references.h" +#include "path-chemistry.h" #include "knotholder.h" #include "style.h" #include "xml/sp-css-attr.h" @@ -93,7 +94,7 @@ LPEMirrorSymmetry::doBeforeEffect (SPLPEItem const* lpeitem) SPLPEItem * splpeitem = const_cast<SPLPEItem *>(lpeitem); if (SPDesktop *desktop = SP_ACTIVE_DESKTOP) { Inkscape::Selection *sel = desktop->getSelection(); - if ( sel && !sel->isEmpty() ) { + if ( sel && !sel->isEmpty() && actual) { SPItem *item = sel->singleItem(); if (item) { if(std::strcmp(splpeitem->getId(),item->getId()) != 0) { @@ -312,7 +313,6 @@ LPEMirrorSymmetry::doOnRemove (SPLPEItem const* /*lpeitem*/) //unset "erase_extra_objects" hook on sp-lpe-item.cpp if (!erase_extra_objects) { processObjects(LPE_TO_OBJECTS); - elements.clear(); return; } processObjects(LPE_ERASE); @@ -333,12 +333,19 @@ LPEMirrorSymmetry::processObjects(LpeAction lpe_action) SVGElemRef->attach(SVGElem_uri); SPObject *elemref = NULL; if (elemref = SVGElemRef->getObject()) { + Inkscape::XML::Node * elemnode = elemref->getRepr(); + std::vector<SPItem*> item_list; + item_list.push_back(SP_ITEM(elemref)); + std::vector<Inkscape::XML::Node*> item_to_select; + std::vector<SPItem*> item_selected; SPCSSAttr *css; Glib::ustring css_str; switch (lpe_action){ case LPE_TO_OBJECTS: - elemref->getRepr()->setAttribute("inkscape:path-effect", NULL); - elemref->getRepr()->setAttribute("sodipodi:insensitive", NULL); + if (elemnode->attribute("inkscape:path-effect")) { + sp_item_list_to_curves(item_list, item_selected, item_to_select); + } + elemnode->setAttribute("sodipodi:insensitive", NULL); break; case LPE_ERASE: @@ -356,7 +363,7 @@ LPEMirrorSymmetry::processObjects(LpeAction lpe_action) css->setAttribute("display", NULL); } sp_repr_css_write_string(css,css_str); - elemref->getRepr()->setAttribute("style", css_str.c_str()); + elemnode->setAttribute("style", css_str.c_str()); break; default: @@ -364,7 +371,7 @@ LPEMirrorSymmetry::processObjects(LpeAction lpe_action) } } } - if (lpe_action == LPE_ERASE) { + if (lpe_action == LPE_ERASE || lpe_action == LPE_TO_OBJECTS) { elements.clear(); } } @@ -627,7 +634,6 @@ KnotHolderEntityCenterMirrorSymmetry::knot_set(Geom::Point const &p, Geom::Point LPEMirrorSymmetry* lpe = dynamic_cast<LPEMirrorSymmetry *>(_effect); Geom::Point const s = snap_knot_position(p, state); lpe->center_point = s; - // FIXME: this should not directly ask for updating the item. It should write to SVG, which triggers updating. sp_lpe_item_update_patheffect (SP_LPE_ITEM(item), false, true); } |
