Merge lp:~inkscape+alexander/inkscape/move-boolops into lp:~inkscape.dev/inkscape/trunk

Proposed by Alexander Brock
Status: Merged
Approved by: Mc
Approved revision: no longer in the source branch.
Merged at revision: 15232
Proposed branch: lp:~inkscape+alexander/inkscape/move-boolops
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 545 lines (+128/-171)
11 files modified
src/livarot/LivarotDefs.h (+0/-12)
src/livarot/Shape.h (+1/-0)
src/livarot/int-line.h (+1/-0)
src/object-set.h (+36/-1)
src/splivarot.cpp (+72/-121)
src/splivarot.h (+1/-20)
src/ui/tools/calligraphic-tool.cpp (+2/-2)
src/ui/tools/eraser-tool.cpp (+6/-6)
src/ui/tools/flood-tool.cpp (+1/-1)
src/ui/tools/spray-tool.cpp (+2/-2)
src/verbs.cpp (+6/-6)
To merge this branch: bzr merge lp:~inkscape+alexander/inkscape/move-boolops
Reviewer Review Type Date Requested Status
Mc Pending
Review via email: mp+310388@code.launchpad.net

Description of the change

Move boolop functions from sp_selected_path_<op> to ObjectSet::path<op>

To post a comment you must log in.
15230. By Tavmjong Bah

Enable swapping of fill and stroke when one is a mesh.

15231. By Tavmjong Bah

Click-drag selects nodes rather than creates new mesh if mesh already exists.

15232. By Mc

merge boolop branch: Move boolop functions from sp_selected_path_<op> to ObjectSet::path<op>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/livarot/LivarotDefs.h'
--- src/livarot/LivarotDefs.h 2016-04-11 12:56:03 +0000
+++ src/livarot/LivarotDefs.h 2016-11-09 00:34:30 +0000
@@ -40,18 +40,6 @@
40 found_between = 440 found_between = 4
41};41};
4242
43// boolean operation
44enum bool_op
45{
46 bool_op_union, // A OR B
47 bool_op_inters, // A AND B
48 bool_op_diff, // A \ B
49 bool_op_symdiff, // A XOR B
50 bool_op_cut, // coupure (pleines)
51 bool_op_slice // coupure (contour)
52};
53typedef enum bool_op BooleanOp;
54
55// types of cap for stroking polylines43// types of cap for stroking polylines
56enum butt_typ44enum butt_typ
57{45{
5846
=== modified file 'src/livarot/Shape.h'
--- src/livarot/Shape.h 2014-03-30 22:08:13 +0000
+++ src/livarot/Shape.h 2016-11-09 00:34:30 +0000
@@ -17,6 +17,7 @@
17#include <2geom/point.h>17#include <2geom/point.h>
1818
19#include "livarot/LivarotDefs.h"19#include "livarot/LivarotDefs.h"
20#include "object-set.h"
2021
21class Path;22class Path;
22class FloatLigne;23class FloatLigne;
2324
=== modified file 'src/livarot/int-line.h'
--- src/livarot/int-line.h 2011-10-04 05:43:09 +0000
+++ src/livarot/int-line.h 2016-11-09 00:34:30 +0000
@@ -2,6 +2,7 @@
2#define INKSCAPE_LIVAROT_INT_LINE_H2#define INKSCAPE_LIVAROT_INT_LINE_H
33
4#include "livarot/LivarotDefs.h"4#include "livarot/LivarotDefs.h"
5#include "object-set.h"
56
6/** \file7/** \file
7 * Coverage with integer boundaries.8 * Coverage with integer boundaries.
89
=== modified file 'src/object-set.h'
--- src/object-set.h 2016-11-06 22:07:52 +0000
+++ src/object-set.h 2016-11-09 00:34:30 +0000
@@ -33,6 +33,29 @@
33#include "sp-item-group.h"33#include "sp-item-group.h"
34#include "desktop.h"34#include "desktop.h"
35#include "document.h"35#include "document.h"
36#include "verbs.h"
37
38enum BoolOpErrors {
39 DONE,
40 DONE_NO_PATH,
41 DONE_NO_ACTION,
42 ERR_TOO_LESS_PATHS_1,
43 ERR_TOO_LESS_PATHS_2,
44 ERR_NO_PATHS,
45 ERR_Z_ORDER
46};
47
48// boolean operation
49enum bool_op
50{
51 bool_op_union, // A OR B
52 bool_op_inters, // A AND B
53 bool_op_diff, // A \ B
54 bool_op_symdiff, // A XOR B
55 bool_op_cut, // coupure (pleines)
56 bool_op_slice // coupure (contour)
57};
58typedef enum bool_op BooleanOp;
3659
37class SPBox3D;60class SPBox3D;
38class Persp3D;61class Persp3D;
@@ -376,7 +399,16 @@
376 void toCurves(bool skip_undo = false);399 void toCurves(bool skip_undo = false);
377 void toLPEItems();400 void toLPEItems();
378 void pathReverse();401 void pathReverse();
379 402
403 // Boolean operations
404 // in splivarot.cpp
405 bool pathUnion(const bool skip_undo = false);
406 bool pathIntersect(const bool skip_undo = false);
407 bool pathDiff(const bool skip_undo = false);
408 bool pathSymDiff(const bool skip_undo = false);
409 bool pathCut(const bool skip_undo = false);
410 bool pathSlice(const bool skip_undo = false);
411
380 //Other path operations412 //Other path operations
381 //in selection-chemistry.cpp413 //in selection-chemistry.cpp
382 void toMarker(bool apply = true);414 void toMarker(bool apply = true);
@@ -438,6 +470,9 @@
438 std::list<SPBox3D *> _3dboxes;470 std::list<SPBox3D *> _3dboxes;
439 std::unordered_map<SPObject*, sigc::connection> _releaseConnections;471 std::unordered_map<SPObject*, sigc::connection> _releaseConnections;
440472
473private:
474 BoolOpErrors pathBoolOp(bool_op bop, const bool skip_undo, const unsigned int verb = SP_VERB_NONE, const Glib::ustring description = "");
475
441};476};
442477
443typedef ObjectSet::SPItemRange SPItemRange;478typedef ObjectSet::SPItemRange SPItemRange;
444479
=== modified file 'src/splivarot.cpp'
--- src/splivarot.cpp 2016-09-02 19:32:55 +0000
+++ src/splivarot.cpp 2016-11-09 00:34:30 +0000
@@ -47,96 +47,51 @@
47#include "verbs.h"47#include "verbs.h"
48#include "2geom/svg-path-parser.h" // to get from SVG on boolean to Geom::Path48#include "2geom/svg-path-parser.h" // to get from SVG on boolean to Geom::Path
4949
50enum BoolOpErrors {
51 DONE,
52 DONE_NO_PATH,
53 DONE_NO_ACTION,
54 ERR_TOO_LESS_PATHS_1,
55 ERR_TOO_LESS_PATHS_2,
56 ERR_NO_PATHS,
57 ERR_Z_ORDER
58};
59
60using Inkscape::DocumentUndo;50using Inkscape::DocumentUndo;
6151
62bool Ancetre(Inkscape::XML::Node *a, Inkscape::XML::Node *who);52bool Ancetre(Inkscape::XML::Node *a, Inkscape::XML::Node *who);
6353
64void sp_selected_path_boolop_ui(Inkscape::Selection *selection, SPDesktop *desktop, bool_op bop,
65 const unsigned int verb = SP_VERB_NONE, const Glib::ustring description = "");
66BoolOpErrors sp_selected_path_boolop(Inkscape::ObjectSet *set, bool_op bop);
67void sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset);54void sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset);
68void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool updating);55void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool updating);
6956
70void57bool Inkscape::ObjectSet::pathUnion(const bool skip_undo) {
71sp_selected_path_union(Inkscape::Selection *selection, SPDesktop *desktop)58 BoolOpErrors result = pathBoolOp(bool_op_union, skip_undo, SP_VERB_SELECTION_UNION, _("Union"));
72{59 return DONE == result;
73 sp_selected_path_boolop_ui(selection, desktop, bool_op_union, SP_VERB_SELECTION_UNION, _("Union"));60}
74}61
7562bool
76void63Inkscape::ObjectSet::pathIntersect(const bool skip_undo)
77sp_selected_path_union_skip_undo(Inkscape::ObjectSet *set)64{
78{65 BoolOpErrors result = pathBoolOp(bool_op_inters, skip_undo, SP_VERB_SELECTION_INTERSECT, _("Intersection"));
79 sp_selected_path_boolop(set, bool_op_union);66 return DONE == result;
80}67}
8168
82void69bool
83sp_selected_path_intersect(Inkscape::Selection *selection, SPDesktop *desktop)70Inkscape::ObjectSet::pathDiff(const bool skip_undo)
84{71{
85 sp_selected_path_boolop_ui(selection, desktop, bool_op_inters, SP_VERB_SELECTION_INTERSECT, _("Intersection"));72 BoolOpErrors result = pathBoolOp(bool_op_diff, skip_undo, SP_VERB_SELECTION_DIFF, _("Difference"));
86}73 return DONE == result;
8774}
88void75
89sp_selected_path_intersect_skip_undo(Inkscape::ObjectSet *set)76bool
90{77Inkscape::ObjectSet::pathSymDiff(const bool skip_undo)
91 sp_selected_path_boolop(set, bool_op_inters);78{
92}79 BoolOpErrors result = pathBoolOp(bool_op_symdiff, skip_undo, SP_VERB_SELECTION_SYMDIFF, _("Exclusion"));
9380 return DONE == result;
94void81}
95sp_selected_path_diff(Inkscape::Selection *selection, SPDesktop *desktop)82
96{83bool
97 sp_selected_path_boolop_ui(selection, desktop, bool_op_diff, SP_VERB_SELECTION_DIFF, _("Difference"));84Inkscape::ObjectSet::pathCut(const bool skip_undo)
98}85{
9986 BoolOpErrors result = pathBoolOp(bool_op_cut, skip_undo, SP_VERB_SELECTION_CUT, _("Division"));
100void87 return DONE == result;
101sp_selected_path_diff_skip_undo(Inkscape::ObjectSet *set)88}
102{89
103 sp_selected_path_boolop(set, bool_op_diff);90bool
104}91Inkscape::ObjectSet::pathSlice(const bool skip_undo)
10592{
106void93 BoolOpErrors result = pathBoolOp(bool_op_slice, skip_undo, SP_VERB_SELECTION_SLICE, _("Cut path"));
107sp_selected_path_symdiff(Inkscape::Selection *selection, SPDesktop *desktop)94 return DONE == result;
108{
109 sp_selected_path_boolop_ui(selection, desktop, bool_op_symdiff, SP_VERB_SELECTION_SYMDIFF, _("Exclusion"));
110}
111
112void
113sp_selected_path_symdiff_skip_undo(Inkscape::ObjectSet *set)
114{
115 sp_selected_path_boolop(set, bool_op_symdiff);
116}
117
118void
119sp_selected_path_cut(Inkscape::Selection *selection, SPDesktop *desktop)
120{
121 sp_selected_path_boolop_ui(selection, desktop, bool_op_cut, SP_VERB_SELECTION_CUT, _("Division"));
122}
123
124void
125sp_selected_path_cut_skip_undo(Inkscape::ObjectSet *set)
126{
127 sp_selected_path_boolop(set, bool_op_cut);
128}
129
130void
131sp_selected_path_slice(Inkscape::Selection *selection, SPDesktop *desktop)
132{
133 sp_selected_path_boolop_ui(selection, desktop, bool_op_slice, SP_VERB_SELECTION_SLICE, _("Cut path"));
134}
135
136void
137sp_selected_path_slice_skip_undo(Inkscape::ObjectSet *set)
138{
139 sp_selected_path_boolop(set, bool_op_slice);
140}95}
14196
142// helper for printing error messages, regardless of whether we have a GUI or not97// helper for printing error messages, regardless of whether we have a GUI or not
@@ -352,10 +307,36 @@
352307
353// boolean operations on the desktop308// boolean operations on the desktop
354// take the source paths from the file, do the operation, delete the originals and add the results309// take the source paths from the file, do the operation, delete the originals and add the results
355BoolOpErrors sp_selected_path_boolop(Inkscape::ObjectSet * set, bool_op bop)310BoolOpErrors Inkscape::ObjectSet::pathBoolOp(bool_op bop, const bool skip_undo, const unsigned int verb, const Glib::ustring description)
356{311{
357 SPDocument *doc = set->desktop()->getDocument();312 if (nullptr != desktop() && !skip_undo) {
358 std::vector<SPItem*> il(set->items().begin(), set->items().end());313 SPDocument *doc = desktop()->getDocument();
314 BoolOpErrors returnCode = ObjectSet::pathBoolOp(bop, true);
315 switch(returnCode) {
316 case ERR_TOO_LESS_PATHS_1:
317 boolop_display_error_message(desktop(), _("Select <b>at least 1 path</b> to perform a boolean union."));
318 break;
319 case ERR_TOO_LESS_PATHS_2:
320 boolop_display_error_message(desktop(), _("Select <b>at least 2 paths</b> to perform a boolean operation."));
321 break;
322 case ERR_NO_PATHS:
323 boolop_display_error_message(desktop(), _("One of the objects is <b>not a path</b>, cannot perform boolean operation."));
324 break;
325 case ERR_Z_ORDER:
326 boolop_display_error_message(desktop(), _("Unable to determine the <b>z-order</b> of the objects selected for difference, XOR, division, or path cut."));
327 break;
328 case DONE_NO_PATH:
329 DocumentUndo::done(doc, SP_VERB_NONE, description);
330 break;
331 case DONE:
332 DocumentUndo::done(doc, verb, description);
333 break;
334 }
335 return returnCode;
336 }
337
338 SPDocument *doc = document();
339 std::vector<SPItem*> il(items().begin(), items().end());
359340
360 // allow union on a single object for the purpose of removing self overlapse (svn log, revision 13334)341 // allow union on a single object for the purpose of removing self overlapse (svn log, revision 13334)
361 if (il.size() < 2 && bop != bool_op_union) {342 if (il.size() < 2 && bop != bool_op_union) {
@@ -687,7 +668,7 @@
687 for (std::vector<SPItem*>::const_iterator l = il.begin(); l != il.end(); l++){668 for (std::vector<SPItem*>::const_iterator l = il.begin(); l != il.end(); l++){
688 (*l)->deleteObject();669 (*l)->deleteObject();
689 }670 }
690 set->clear();671 clear();
691672
692 delete res;673 delete res;
693 return DONE_NO_PATH;674 return DONE_NO_PATH;
@@ -703,7 +684,7 @@
703 }684 }
704 } else {685 } else {
705 // find out the bottom object686 // find out the bottom object
706 std::vector<Inkscape::XML::Node*> sorted(set->xmlNodes().begin(), set->xmlNodes().end());687 std::vector<Inkscape::XML::Node*> sorted(xmlNodes().begin(), xmlNodes().end());
707688
708 sort(sorted.begin(),sorted.end(),sp_repr_compare_position_bool);689 sort(sorted.begin(),sorted.end(),sp_repr_compare_position_bool);
709690
@@ -731,7 +712,7 @@
731 gchar *title = source->title();712 gchar *title = source->title();
732 gchar *desc = source->desc();713 gchar *desc = source->desc();
733 // remove source paths714 // remove source paths
734 set->clear();715 clear();
735 for (std::vector<SPItem*>::const_iterator l = il.begin(); l != il.end(); l++){716 for (std::vector<SPItem*>::const_iterator l = il.begin(); l != il.end(); l++){
736 // if this is the bottommost object,717 // if this is the bottommost object,
737 if (!strcmp(reinterpret_cast<SPObject *>(*l)->getRepr()->attribute("id"), id)) {718 if (!strcmp(reinterpret_cast<SPObject *>(*l)->getRepr()->attribute("id"), id)) {
@@ -810,7 +791,7 @@
810 // move to the saved position791 // move to the saved position
811 repr->setPosition(pos > 0 ? pos : 0);792 repr->setPosition(pos > 0 ? pos : 0);
812793
813 set->add(doc->getObjectByRepr(repr));794 add(doc->getObjectByRepr(repr));
814 Inkscape::GC::release(repr);795 Inkscape::GC::release(repr);
815796
816 delete resPath[i];797 delete resPath[i];
@@ -845,7 +826,7 @@
845 }826 }
846 repr->setPosition(pos > 0 ? pos : 0);827 repr->setPosition(pos > 0 ? pos : 0);
847828
848 set->add(doc->getObjectByRepr(repr));829 add(doc->getObjectByRepr(repr));
849 Inkscape::GC::release(repr);830 Inkscape::GC::release(repr);
850 }831 }
851832
@@ -858,36 +839,6 @@
858 return DONE;839 return DONE;
859}840}
860841
861void sp_selected_path_boolop_ui(Inkscape::Selection *selection, SPDesktop *desktop, bool_op bop, const unsigned int verb,
862 const Glib::ustring description)
863{
864 SPDocument *doc = selection->desktop()->getDocument();
865 BoolOpErrors returnCode = sp_selected_path_boolop(selection, bop);
866 switch(returnCode) {
867 case ERR_TOO_LESS_PATHS_1:
868 boolop_display_error_message(desktop, _("Select <b>at least 1 path</b> to perform a boolean union."));
869 return;
870 case ERR_TOO_LESS_PATHS_2:
871 boolop_display_error_message(desktop, _("Select <b>at least 2 paths</b> to perform a boolean operation."));
872 return;
873 case ERR_NO_PATHS:
874 boolop_display_error_message(desktop, _("One of the objects is <b>not a path</b>, cannot perform boolean operation."));
875 return;
876 case ERR_Z_ORDER:
877 boolop_display_error_message(desktop, _("Unable to determine the <b>z-order</b> of the objects selected for difference, XOR, division, or path cut."));
878 return;
879 case DONE_NO_PATH:
880 DocumentUndo::done(doc, SP_VERB_NONE, description);
881 return;
882 case DONE:
883 DocumentUndo::done(doc, verb, description);
884 return;
885 case DONE_NO_ACTION:
886 default:
887 return;
888 }
889}
890
891static842static
892void sp_selected_path_outline_add_marker( SPObject *marker_object, Geom::Affine marker_transform,843void sp_selected_path_outline_add_marker( SPObject *marker_object, Geom::Affine marker_transform,
893 Geom::Scale stroke_scale, Geom::Affine transform,844 Geom::Scale stroke_scale, Geom::Affine transform,
894845
=== modified file 'src/splivarot.h'
--- src/splivarot.h 2016-08-09 09:33:34 +0000
+++ src/splivarot.h 2016-11-09 00:34:30 +0000
@@ -10,6 +10,7 @@
10#include <2geom/forward.h>10#include <2geom/forward.h>
11#include <2geom/path.h>11#include <2geom/path.h>
12#include "livarot/Path.h"12#include "livarot/Path.h"
13#include "object-set.h"
1314
14class SPCurve;15class SPCurve;
15class SPDesktop;16class SPDesktop;
@@ -20,26 +21,6 @@
20 class ObjectSet;21 class ObjectSet;
21}22}
2223
23// boolean operations
24// work on the current selection
25// selection has 2 contain exactly 2 items
26
27// UPDATE: these signatures have been modified so they may work in
28// command-line mode, i.e. without a desktop. If a desktop is not
29// provided (desktop == NULL), error messages will be shown on stderr.
30void sp_selected_path_union (Inkscape::Selection *selection, SPDesktop *desktop);
31void sp_selected_path_union_skip_undo (Inkscape::ObjectSet *set);
32void sp_selected_path_intersect (Inkscape::Selection *selection, SPDesktop *desktop);
33void sp_selected_path_intersect_skip_undo (Inkscape::ObjectSet *set);
34void sp_selected_path_diff (Inkscape::Selection *selection, SPDesktop *desktop);
35void sp_selected_path_diff_skip_undo (Inkscape::ObjectSet *set);
36void sp_selected_path_symdiff (Inkscape::Selection *selection, SPDesktop *desktop);
37void sp_selected_path_symdiff_skip_undo (Inkscape::ObjectSet *set);
38void sp_selected_path_cut (Inkscape::Selection *selection, SPDesktop *desktop);
39void sp_selected_path_cut_skip_undo (Inkscape::ObjectSet *set);
40void sp_selected_path_slice (Inkscape::Selection *selection, SPDesktop *desktop);
41void sp_selected_path_slice_skip_undo (Inkscape::ObjectSet *set);
42
43// offset/inset of a curve24// offset/inset of a curve
44// takes the fill-rule in consideration25// takes the fill-rule in consideration
45// offset amount is the stroke-width of the curve26// offset amount is the stroke-width of the curve
4627
=== modified file 'src/ui/tools/calligraphic-tool.cpp'
--- src/ui/tools/calligraphic-tool.cpp 2016-08-29 20:39:07 +0000
+++ src/ui/tools/calligraphic-tool.cpp 2016-11-09 00:34:30 +0000
@@ -921,10 +921,10 @@
921921
922 if (unionize) {922 if (unionize) {
923 desktop->getSelection()->add(this->repr);923 desktop->getSelection()->add(this->repr);
924 sp_selected_path_union_skip_undo(desktop->getSelection());924 desktop->getSelection()->pathUnion(true);
925 } else if (subtract) {925 } else if (subtract) {
926 desktop->getSelection()->add(this->repr);926 desktop->getSelection()->add(this->repr);
927 sp_selected_path_diff_skip_undo(desktop->getSelection());927 desktop->getSelection()->pathDiff(true);
928 } else {928 } else {
929 if (this->keep_selected) {929 if (this->keep_selected) {
930 desktop->getSelection()->set(this->repr);930 desktop->getSelection()->set(this->repr);
931931
=== modified file 'src/ui/tools/eraser-tool.cpp'
--- src/ui/tools/eraser-tool.cpp 2016-10-24 22:58:43 +0000
+++ src/ui/tools/eraser-tool.cpp 2016-11-09 00:34:30 +0000
@@ -714,7 +714,7 @@
714 Inkscape::GC::release(dup); // parent takes over714 Inkscape::GC::release(dup); // parent takes over
715 selection->set(dup);715 selection->set(dup);
716 if (!this->nowidth) {716 if (!this->nowidth) {
717 sp_selected_path_union_skip_undo(selection);717 selection->pathUnion(true);
718 }718 }
719 selection->add(item);719 selection->add(item);
720 if(item->style->fill_rule.value == SP_WIND_RULE_EVENODD){720 if(item->style->fill_rule.value == SP_WIND_RULE_EVENODD){
@@ -725,9 +725,9 @@
725 css = 0;725 css = 0;
726 }726 }
727 if (this->nowidth) {727 if (this->nowidth) {
728 sp_selected_path_cut_skip_undo(selection);728 selection->pathCut(true);
729 } else {729 } else {
730 sp_selected_path_diff_skip_undo(selection);730 selection->pathDiff(true);
731 }731 }
732 workDone = true; // TODO set this only if something was cut.732 workDone = true; // TODO set this only if something was cut.
733 bool break_apart = prefs->getBool("/tools/eraser/break_apart", false);733 bool break_apart = prefs->getBool("/tools/eraser/break_apart", false);
@@ -762,7 +762,7 @@
762 this->repr->parent()->appendChild(dup);762 this->repr->parent()->appendChild(dup);
763 Inkscape::GC::release(dup); // parent takes over763 Inkscape::GC::release(dup); // parent takes over
764 selection->set(dup);764 selection->set(dup);
765 sp_selected_path_union_skip_undo(selection);765 selection->pathUnion(true);
766 if (bbox && bbox->intersects(*eraserBbox)) {766 if (bbox && bbox->intersects(*eraserBbox)) {
767 SPClipPath *clip_path = item->clip_ref->getObject();767 SPClipPath *clip_path = item->clip_ref->getObject();
768 if (clip_path) {768 if (clip_path) {
@@ -786,7 +786,7 @@
786 sp_object_unref(clip_path);786 sp_object_unref(clip_path);
787 selection->raiseToTop(true);787 selection->raiseToTop(true);
788 selection->add(dup_clip);788 selection->add(dup_clip);
789 sp_selected_path_diff_skip_undo(selection);789 selection->pathDiff(true);
790 SPItem * clip = SP_ITEM(*(selection->items().begin()));790 SPItem * clip = SP_ITEM(*(selection->items().begin()));
791 }791 }
792 }792 }
@@ -802,7 +802,7 @@
802 rect->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);802 rect->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
803 selection->raiseToTop(true);803 selection->raiseToTop(true);
804 selection->add(rect);804 selection->add(rect);
805 sp_selected_path_diff_skip_undo(selection);805 selection->pathDiff(true);
806 }806 }
807 selection->raiseToTop(true);807 selection->raiseToTop(true);
808 selection->add(item);808 selection->add(item);
809809
=== modified file 'src/ui/tools/flood-tool.cpp'
--- src/ui/tools/flood-tool.cpp 2016-08-03 14:56:48 +0000
+++ src/ui/tools/flood-tool.cpp 2016-11-09 00:34:30 +0000
@@ -446,7 +446,7 @@
446 ngettext("Area filled, path with <b>%d</b> node created and unioned with selection.","Area filled, path with <b>%d</b> nodes created and unioned with selection.",446 ngettext("Area filled, path with <b>%d</b> node created and unioned with selection.","Area filled, path with <b>%d</b> nodes created and unioned with selection.",
447 SP_PATH(reprobj)->nodesInPath()), SP_PATH(reprobj)->nodesInPath() );447 SP_PATH(reprobj)->nodesInPath()), SP_PATH(reprobj)->nodesInPath() );
448 selection->add(reprobj);448 selection->add(reprobj);
449 sp_selected_path_union_skip_undo(desktop->getSelection());449 selection->pathUnion(true);
450 } else {450 } else {
451 desktop->messageStack()->flashF( Inkscape::WARNING_MESSAGE,451 desktop->messageStack()->flashF( Inkscape::WARNING_MESSAGE,
452 ngettext("Area filled, path with <b>%d</b> node created.","Area filled, path with <b>%d</b> nodes created.",452 ngettext("Area filled, path with <b>%d</b> node created.","Area filled, path with <b>%d</b> nodes created.",
453453
=== modified file 'src/ui/tools/spray-tool.cpp'
--- src/ui/tools/spray-tool.cpp 2016-08-03 14:56:48 +0000
+++ src/ui/tools/spray-tool.cpp 2016-11-09 00:34:30 +0000
@@ -1026,7 +1026,7 @@
1026 if (unionResult) { // No need to add the very first item (initialized with NULL).1026 if (unionResult) { // No need to add the very first item (initialized with NULL).
1027 set->add(unionResult);1027 set->add(unionResult);
1028 }1028 }
1029 sp_selected_path_union_skip_undo(set);1029 set->pathUnion(true);
1030 set->add(parent_item);1030 set->add(parent_item);
1031 Inkscape::GC::release(copy);1031 Inkscape::GC::release(copy);
1032 did = true;1032 did = true;
@@ -1364,7 +1364,7 @@
1364 SP_VERB_CONTEXT_SPRAY, _("Spray with clones"));1364 SP_VERB_CONTEXT_SPRAY, _("Spray with clones"));
1365 break;1365 break;
1366 case SPRAY_MODE_SINGLE_PATH:1366 case SPRAY_MODE_SINGLE_PATH:
1367 sp_selected_path_union_skip_undo(objectSet());1367 objectSet()->pathUnion(true);
1368 desktop->getSelection()->add(object_set.objects().begin(), object_set.objects().end());1368 desktop->getSelection()->add(object_set.objects().begin(), object_set.objects().end());
1369 DocumentUndo::done(this->desktop->getDocument(),1369 DocumentUndo::done(this->desktop->getDocument(),
1370 SP_VERB_CONTEXT_SPRAY, _("Spray in single path"));1370 SP_VERB_CONTEXT_SPRAY, _("Spray in single path"));
13711371
=== modified file 'src/verbs.cpp'
--- src/verbs.cpp 2016-11-06 22:07:52 +0000
+++ src/verbs.cpp 2016-11-09 00:34:30 +0000
@@ -1115,22 +1115,22 @@
1115 bool handled = true;1115 bool handled = true;
1116 switch (reinterpret_cast<std::size_t>(data)) {1116 switch (reinterpret_cast<std::size_t>(data)) {
1117 case SP_VERB_SELECTION_UNION:1117 case SP_VERB_SELECTION_UNION:
1118 sp_selected_path_union(selection, dt);1118 selection->pathUnion();
1119 break;1119 break;
1120 case SP_VERB_SELECTION_INTERSECT:1120 case SP_VERB_SELECTION_INTERSECT:
1121 sp_selected_path_intersect(selection, dt);1121 selection->pathIntersect();
1122 break;1122 break;
1123 case SP_VERB_SELECTION_DIFF:1123 case SP_VERB_SELECTION_DIFF:
1124 sp_selected_path_diff(selection, dt);1124 selection->pathDiff();
1125 break;1125 break;
1126 case SP_VERB_SELECTION_SYMDIFF:1126 case SP_VERB_SELECTION_SYMDIFF:
1127 sp_selected_path_symdiff(selection, dt);1127 selection->pathSymDiff();
1128 break;1128 break;
1129 case SP_VERB_SELECTION_CUT:1129 case SP_VERB_SELECTION_CUT:
1130 sp_selected_path_cut(selection, dt);1130 selection->pathCut();
1131 break;1131 break;
1132 case SP_VERB_SELECTION_SLICE:1132 case SP_VERB_SELECTION_SLICE:
1133 sp_selected_path_slice(selection, dt);1133 selection->pathSlice();
1134 break;1134 break;
1135 case SP_VERB_SELECTION_GROW:1135 case SP_VERB_SELECTION_GROW:
1136 {1136 {