implement RangeMarkerBarDrag::abort
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 5 Feb 2015 23:20:53 +0000 (18:20 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 6 Feb 2015 00:34:31 +0000 (19:34 -0500)
Conflicts:
gtk2_ardour/editor_drag.cc

gtk2_ardour/editor_drag.cc
gtk2_ardour/editor_drag.h

index 7ac8f9c16ac0c29eaa12321c0cd28268b5a1b72d..d82156bfd11e4132c2e5f2857e2c6c8f95f837e2 100644 (file)
@@ -4507,6 +4507,15 @@ RangeMarkerBarDrag::RangeMarkerBarDrag (Editor* e, ArdourCanvas::Item* i, Operat
        _drag_rect->set_outline_color (ARDOUR_UI::config()->color ("range drag rect"));
 }
 
+RangeMarkerBarDrag::~RangeMarkerBarDrag()
+{
+       /* normal canvas items will be cleaned up when their parent group is deleted. But 
+          this item is created as the child of a long-lived parent group, and so we
+          need to explicitly delete it.
+       */
+       delete _drag_rect;
+}
+
 void
 RangeMarkerBarDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
 {
@@ -4714,9 +4723,12 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred)
 }
 
 void
-RangeMarkerBarDrag::aborted (bool)
+RangeMarkerBarDrag::aborted (bool movement_occured)
 {
-       /* XXX: TODO */
+       if (movement_occured) {
+               _crect->hide ();
+               _drag_rect->hide ();
+       }
 }
 
 void
index 66ea64eb546f8b0a04f2f4bd8f9cfff46c11f34b..64e894c092ac741219b94a0ff81bdac2dace32eb 100644 (file)
@@ -995,7 +995,8 @@ public:
        };
 
        RangeMarkerBarDrag (Editor *, ArdourCanvas::Item *, Operation);
-
+       ~RangeMarkerBarDrag ();
+       
        void start_grab (GdkEvent *, Gdk::Cursor* c = 0);
        void motion (GdkEvent *, bool);
        void finished (GdkEvent *, bool);