diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-07 08:16:57 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-07-07 08:16:57 -0400 |
commit | 4685a15b1fda18046a11473cd89854ddd96b5c51 (patch) | |
tree | b044003060396335f7441117d49f9e9ebc50778f | |
parent | a1bc2cb10e1cc6fa05b04c85f98cf0622afe99f1 (diff) |
add new variant of EditorCursor that creates an insensitive full-canvas-height line, and fix destructor leak
-rw-r--r-- | gtk2_ardour/editor_cursors.cc | 17 | ||||
-rw-r--r-- | gtk2_ardour/editor_cursors.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index ffe6fc0d01..740b96f965 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -52,9 +52,24 @@ EditorCursor::EditorCursor (Editor& ed, bool (Editor::*callbck)(GdkEvent*,Ardour _current_frame = 1; /* force redraw at 0 */ } -EditorCursor::~EditorCursor () +EditorCursor::EditorCursor (Editor& ed) + : _editor (ed) + , _track_canvas_item (new ArdourCanvas::Arrow (_editor.get_hscroll_group())) + , _length (1.0) { + CANVAS_DEBUG_NAME (_track_canvas_item, "track canvas cursor"); + + _track_canvas_item->set_show_head (0, false); + _track_canvas_item->set_show_head (1, false); + _track_canvas_item->set_y1 (ArdourCanvas::COORD_MAX); + _track_canvas_item->set_ignore_events (true); + _current_frame = 1; /* force redraw at 0 */ +} + +EditorCursor::~EditorCursor () +{ + delete _track_canvas_item; } void diff --git a/gtk2_ardour/editor_cursors.h b/gtk2_ardour/editor_cursors.h index 50958d1ac0..eb4ab1cbde 100644 --- a/gtk2_ardour/editor_cursors.h +++ b/gtk2_ardour/editor_cursors.h @@ -29,6 +29,7 @@ class Editor; class EditorCursor { public: EditorCursor (Editor&, bool (Editor::*)(GdkEvent*,ArdourCanvas::Item*)); + EditorCursor (Editor&); ~EditorCursor (); void set_position (framepos_t); |