don't request redraw of a Canvas item if it marked invisible
[ardour.git] / gtk2_ardour / marker.cc
index e45cf0fb2a0466c1f68f764ff17a1a36c07013f5..652a43657e1ebe273fe3765329d9d19c04f92541 100644 (file)
@@ -26,6 +26,7 @@
 #include "canvas/polygon.h"
 #include "canvas/text.h"
 #include "canvas/canvas.h"
+#include "canvas/debug.h"
 
 #include "ardour_ui.h"
 /*
@@ -248,17 +249,14 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
 #ifdef CANVAS_DEBUG
        _name_background->name = string_compose ("Marker::_name_background for %1", annotation);
 #endif 
-       _name_background->set_outline_width (1);
 
        /* adjust to properly locate the tip */
 
        mark = new ArdourCanvas::Polygon (group);
-#ifdef CANVAS_DEBUG
-       mark->name = string_compose ("Marker::mark for %1", annotation);
-#endif 
+       CANVAS_DEBUG_NAME (mark, string_compose ("Marker::mark for %1", annotation));
+
        mark->set (*points);
        set_color_rgba (rgba);
-       mark->set_outline_width (1);
 
        /* setup name pixbuf sizes */
        name_font = get_font_for_style (N_("MarkerText"));
@@ -272,13 +270,10 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
        Gtkmm2ext::get_ink_pixel_size (layout, width, name_height);
        
        _name_item = new ArdourCanvas::Text (group);
+       CANVAS_DEBUG_NAME (_name_item, string_compose ("Marker::_name_item for %1", annotation));
        _name_item->set_font_description (name_font);
        _name_item->set_color (RGBA_TO_UINT (0,0,0,255));
-
-#ifdef CANVAS_DEBUG
-       _name_item->name = string_compose ("Marker::_name_item for %1", annotation);
-#endif 
-       _name_item->set_position (ArdourCanvas::Duple (_label_offset, (13.0 / 2.0) - (name_height / 2.0)));
+       _name_item->set_position (ArdourCanvas::Duple (_label_offset, (13.0 / 2.0) - (name_height / 2.0) - 2.0));
 
        set_name (annotation.c_str());
 
@@ -294,7 +289,6 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
        if (handle_events) {
                group->Event.connect (sigc::bind (sigc::mem_fun (editor, &PublicEditor::canvas_marker_event), group, this));
        }
-
 }
 
 Marker::~Marker ()