diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-02-19 10:48:41 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-02-19 10:48:41 +0000 |
| commit | f15ac06ffd9cc8dbb098b18a6b273b32fc904fc9 (patch) | |
| tree | 482bc967d7e637d3f8817aa2074362a461465603 /src/ui/tools/spray-tool.cpp | |
| parent | update to trunk (diff) | |
| parent | Add SVG2 property 'paint-order'. (diff) | |
| download | inkscape-f15ac06ffd9cc8dbb098b18a6b273b32fc904fc9.tar.gz inkscape-f15ac06ffd9cc8dbb098b18a6b273b32fc904fc9.zip | |
update to trunk
(bzr r11950.1.254)
Diffstat (limited to 'src/ui/tools/spray-tool.cpp')
| -rw-r--r-- | src/ui/tools/spray-tool.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index 4ea482461..14a3acd9a 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -430,7 +430,6 @@ static bool sp_spray_recursive(SPDesktop *desktop, SPItem *parent_item = NULL; // Initial object SPItem *item_copied = NULL; // Projected object SPItem *unionResult = NULL; // Previous union - SPItem *child_item = NULL; // Parent copy int i=1; for (GSList *items = g_slist_copy(const_cast<GSList *>(selection->itemList())); @@ -453,21 +452,12 @@ static bool sp_spray_recursive(SPDesktop *desktop, Geom::OptRect a = parent_item->documentVisualBounds(); if (a) { - if (i == 1) { - Inkscape::XML::Node *copy1 = old_repr->duplicate(xml_doc); - parent->appendChild(copy1); - SPObject *new_obj1 = doc->getObjectByRepr(copy1); - child_item = SP_ITEM(new_obj1); // Conversion object->item - unionResult = child_item; - Inkscape::GC::release(copy1); - } - if (_fid <= population) { // Rules the population of objects sprayed // Duplicates the parent item - Inkscape::XML::Node *copy2 = old_repr->duplicate(xml_doc); - parent->appendChild(copy2); - SPObject *new_obj2 = doc->getObjectByRepr(copy2); - item_copied = SP_ITEM(new_obj2); + Inkscape::XML::Node *copy = old_repr->duplicate(xml_doc); + parent->appendChild(copy); + SPObject *new_obj = doc->getObjectByRepr(copy); + item_copied = SP_ITEM(new_obj); // Move around the cursor Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); @@ -481,10 +471,12 @@ static bool sp_spray_recursive(SPDesktop *desktop, // Union and duplication selection->clear(); selection->add(item_copied); - selection->add(unionResult); + if (unionResult) { // No need to add the very first item (initialized with NULL). + selection->add(unionResult); + } sp_selected_path_union_skip_undo(selection, selection->desktop()); selection->add(parent_item); - Inkscape::GC::release(copy2); + Inkscape::GC::release(copy); did = true; } } |
