From 8b41832930729fa5a89584fe9bcd91c45a454be2 Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 7 Apr 2008 15:17:00 +0000 Subject: [PATCH] If environment variable SYNFIG_TOOLS_CLEAR_SELECTION is set, then unselect all layers before creating new layers with any tool (other than the draw tool). git-svn-id: http://svn.voria.com/code@1975 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-studio/trunk/src/gtkmm/state_bline.cpp | 4 +++- synfig-studio/trunk/src/gtkmm/state_circle.cpp | 4 +++- synfig-studio/trunk/src/gtkmm/state_gradient.cpp | 4 +++- synfig-studio/trunk/src/gtkmm/state_polygon.cpp | 4 +++- synfig-studio/trunk/src/gtkmm/state_rectangle.cpp | 4 +++- synfig-studio/trunk/src/gtkmm/state_text.cpp | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/state_bline.cpp b/synfig-studio/trunk/src/gtkmm/state_bline.cpp index 39cf863..8c4ec08 100644 --- a/synfig-studio/trunk/src/gtkmm/state_bline.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_bline.cpp @@ -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(); diff --git a/synfig-studio/trunk/src/gtkmm/state_circle.cpp b/synfig-studio/trunk/src/gtkmm/state_circle.cpp index 38b1797..9cc9b4a 100644 --- a/synfig-studio/trunk/src/gtkmm/state_circle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_circle.cpp @@ -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)); diff --git a/synfig-studio/trunk/src/gtkmm/state_gradient.cpp b/synfig-studio/trunk/src/gtkmm/state_gradient.cpp index 52ead47..9740e4c 100644 --- a/synfig-studio/trunk/src/gtkmm/state_gradient.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_gradient.cpp @@ -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); diff --git a/synfig-studio/trunk/src/gtkmm/state_polygon.cpp b/synfig-studio/trunk/src/gtkmm/state_polygon.cpp index 10c152a..c292138 100644 --- a/synfig-studio/trunk/src/gtkmm/state_polygon.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_polygon.cpp @@ -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); diff --git a/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp b/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp index 3be8344..4226f59 100644 --- a/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp @@ -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); diff --git a/synfig-studio/trunk/src/gtkmm/state_text.cpp b/synfig-studio/trunk/src/gtkmm/state_text.cpp index f1da4e6..b748753 100644 --- a/synfig-studio/trunk/src/gtkmm/state_text.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_text.cpp @@ -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)); -- 2.7.4