diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-10-16 11:07:35 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-10-16 20:20:20 +0000 |
| commit | fb9b208ae9b22e8ced331f4d4e20392c9bc1357b (patch) | |
| tree | 455599e9e03ca2c9f61dc0842cf5680e184f4fc6 /src/path-chemistry.cpp | |
| parent | Extensions: only check existence for interpreted scripts. (diff) | |
| download | inkscape-fb9b208ae9b22e8ced331f4d4e20392c9bc1357b.tar.gz inkscape-fb9b208ae9b22e8ced331f4d4e20392c9bc1357b.zip | |
Inkscape::XML::Node::addChildAtPos
Diffstat (limited to '')
| -rw-r--r-- | src/path-chemistry.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 4ff6d6420..a0f66b3fd 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -171,10 +171,9 @@ ObjectSet::combine(bool skip_undo) g_free(dstring); // add the new group to the parent of the topmost - parent->appendChild(repr); - // move to the position of the topmost, reduced by the number of deleted items - repr->setPosition(position > 0 ? position : 0); + parent->addChildAtPos(repr, position > 0 ? position : 0); + if ( !skip_undo ) { DocumentUndo::done(doc, SP_VERB_SELECTION_COMBINE, _("Combine")); @@ -261,10 +260,8 @@ ObjectSet::breakApart(bool skip_undo) g_free(str); // add the new repr to the parent - parent->appendChild(repr); - // move to the saved position - repr->setPosition(pos > 0 ? pos : 0); + parent->addChildAtPos(repr, pos); // if it's the first one, restore id if (curve == *(list.begin())) @@ -452,10 +449,7 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& // restore class repr->setAttribute("class", class_attr); // add the new repr to the parent - parent->appendChild(repr); - - // move to the saved position - repr->setPosition(pos > 0 ? pos : 0); + parent->addChildAtPos(repr, pos); /* Buglet: We don't re-add the (new version of the) object to the selection of any other * desktops where it was previously selected. */ |
