Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-studio / trunk / src / gtkmm / widget_gradient.cpp
index 41920d9..c964599 100644 (file)
@@ -36,6 +36,8 @@
 #include <synfig/exception.h>
 #include <ETL/misc>
 
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -212,6 +214,7 @@ void
 Widget_Gradient::popup_menu(float x)
 {
        Gtk::Menu* menu(manage(new Gtk::Menu()));
+       menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
 
        menu->items().clear();
 
@@ -292,8 +295,9 @@ Widget_Gradient::on_event(GdkEvent *event)
                case GDK_MOTION_NOTIFY:
                        if(editable_ && y>get_height()-CONTROL_HEIGHT)
                        {
+                               if(!gradient_.size()) return true;
                                Gradient::iterator iter(gradient_.find(selected_cpoint));
-
+                               //! Use SHIFT to stack two CPoints together.
                                if(event->button.state&GDK_SHIFT_MASK)
                                {
                                        float begin(-100000000),end(100000000);