Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / stable / src / gtkmm / state_polygon.cpp
index a5498fe..942d6d8 100644 (file)
@@ -231,8 +231,8 @@ StatePolygon_Context::StatePolygon_Context(CanvasView* canvas_view):
        load_settings();
 
        // Set up the tool options dialog
-       //options_table.attach(*manage(new Gtk::Label(_("Polygon Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
-       options_table.attach(entry_id, 0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+       options_table.attach(*manage(new Gtk::Label(_("Polygon Tool"))),        0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+       options_table.attach(entry_id,                                                                          0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
        //options_table.attach(button_make, 0, 2, 4, 5, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
        button_make.signal_pressed().connect(sigc::mem_fun(*this,&StatePolygon_Context::run));
        options_table.show_all();
@@ -398,8 +398,12 @@ StatePolygon_Context::run()
                                }
                        }
                        egress_on_selection_change=false;
+                       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();
-                       get_canvas_interface()->get_selection_manager()->set_selected_layer(layer);
+                       layer_selection.push_back(layer);
+                       get_canvas_interface()->get_selection_manager()->set_selected_layers(layer_selection);
                        egress_on_selection_change=true;
                        //get_canvas_interface()->signal_dirty_preview()();
                }