If environment variable SYNFIG_TOOLS_CLEAR_SELECTION is set, then unselect all layers...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 7 Apr 2008 15:17:00 +0000 (15:17 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 7 Apr 2008 15:17:00 +0000 (15:17 +0000)
git-svn-id: http://svn.voria.com/code@1975 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/state_bline.cpp
synfig-studio/trunk/src/gtkmm/state_circle.cpp
synfig-studio/trunk/src/gtkmm/state_gradient.cpp
synfig-studio/trunk/src/gtkmm/state_polygon.cpp
synfig-studio/trunk/src/gtkmm/state_rectangle.cpp
synfig-studio/trunk/src/gtkmm/state_text.cpp

index 39cf863..8c4ec08 100644 (file)
@@ -605,7 +605,9 @@ StateBLine_Context::run_()
 
                value_node_bline->set_member_canvas(canvas);
 
-               synfigapp::SelectionManager::LayerList layer_selection(get_canvas_view()->get_selection_manager()->get_selected_layers());
+               synfigapp::SelectionManager::LayerList layer_selection;
+               if (!getenv("SYNFIG_TOOLS_CLEAR_SELECTION"))
+                       layer_selection = get_canvas_view()->get_selection_manager()->get_selected_layers();
 
                // count how many layers we're going to be creating
                int layers_to_create = this->layers_to_create();
index 38b1797..9cc9b4a 100644 (file)
@@ -527,7 +527,9 @@ StateCircle_Context::make_circle(const Point& _p1, const Point& _p2)
                canvas=layer->get_canvas();
        }
 
-       synfigapp::SelectionManager::LayerList layer_selection(get_canvas_view()->get_selection_manager()->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_selection;
+       if (!getenv("SYNFIG_TOOLS_CLEAR_SELECTION"))
+               layer_selection = get_canvas_view()->get_selection_manager()->get_selected_layers();
 
        const synfig::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
        const Point p1(transform.unperform(_p1));
index 52ead47..9740e4c 100644 (file)
@@ -437,7 +437,9 @@ StateGradient_Context::make_gradient(const Point& _p1, const Point& _p2)
        get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
 
        egress_on_selection_change=false;
-       synfigapp::SelectionManager::LayerList layer_selection(get_canvas_view()->get_selection_manager()->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_selection;
+       if (!getenv("SYNFIG_TOOLS_CLEAR_SELECTION"))
+               layer_selection = get_canvas_view()->get_selection_manager()->get_selected_layers();
        get_canvas_interface()->get_selection_manager()->clear_selected_layers();
        layer_selection.push_back(layer);
        get_canvas_interface()->get_selection_manager()->set_selected_layers(layer_selection);
index 10c152a..c292138 100644 (file)
@@ -398,7 +398,9 @@ StatePolygon_Context::run()
                                }
                        }
                        egress_on_selection_change=false;
-                       synfigapp::SelectionManager::LayerList layer_selection(get_canvas_view()->get_selection_manager()->get_selected_layers());
+                       synfigapp::SelectionManager::LayerList layer_selection;
+                       if (!getenv("SYNFIG_TOOLS_CLEAR_SELECTION"))
+                               layer_selection = get_canvas_view()->get_selection_manager()->get_selected_layers();
                        get_canvas_interface()->get_selection_manager()->clear_selected_layers();
                        layer_selection.push_back(layer);
                        get_canvas_interface()->get_selection_manager()->set_selected_layers(layer_selection);
index 3be8344..4226f59 100644 (file)
@@ -394,7 +394,9 @@ StateRectangle_Context::make_rectangle(const Point& _p1, const Point& _p2)
        get_canvas_interface()->signal_layer_new_description()(layer,layer->get_description());
 
        egress_on_selection_change=false;
-       synfigapp::SelectionManager::LayerList layer_selection(get_canvas_view()->get_selection_manager()->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_selection;
+       if (!getenv("SYNFIG_TOOLS_CLEAR_SELECTION"))
+               layer_selection = get_canvas_view()->get_selection_manager()->get_selected_layers();
        get_canvas_interface()->get_selection_manager()->clear_selected_layers();
        layer_selection.push_back(layer);
        get_canvas_interface()->get_selection_manager()->set_selected_layers(layer_selection);
index f1da4e6..b748753 100644 (file)
@@ -384,7 +384,9 @@ StateText_Context::make_text(const Point& _point)
                canvas=layer->get_canvas();
        }
 
-       synfigapp::SelectionManager::LayerList layer_selection(get_canvas_view()->get_selection_manager()->get_selected_layers());
+       synfigapp::SelectionManager::LayerList layer_selection;
+       if (!getenv("SYNFIG_TOOLS_CLEAR_SELECTION"))
+               layer_selection = get_canvas_view()->get_selection_manager()->get_selected_layers();
 
        const synfig::TransformStack& transform(get_canvas_view()->get_curr_transform_stack());
        const Point point(transform.unperform(_point));