an awful lot of tweaks to drawing details
[ardour.git] / gtk2_ardour / tempo_lines.cc
index 27b5aac974997aa84bfd68d1d9b6e9efb8314cb4..6bf7dfbde9081e472f441309545cf9ab95978550 100644 (file)
@@ -47,17 +47,13 @@ TempoLines::tempo_map_changed()
 void
 TempoLines::show ()
 {
-       for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++i) {
-               (*i)->show();
-       }
+       _group->show ();
 }
 
 void
 TempoLines::hide ()
 {
-       for (Lines::iterator i = _lines.begin(); i != _lines.end(); ++i) {
-               (*i)->hide();
-       }
+       _group->hide ();
 }
 
 void
@@ -77,7 +73,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
 
        i = end;
        i--;
-       bars = (*i).bar - (*begin).bar;
+       bars = (*i).bar - (*begin).bar; 
        beats = distance (begin, end) - bars;
 
        beat_density = (beats * 10.0f) / visible.width ();
@@ -111,10 +107,16 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
                        line->reparent (_group);
                } else {
                        line = new ArdourCanvas::Line (_group);
+                       CANVAS_DEBUG_NAME (line, "tempo measure line");
+                       line->set_ignore_events (true);
                }
 
-               line->set_x0 (xpos);
-               line->set_x1 (xpos);
+               /* move to 0.5 offset to ensure single pixel lines (see Cairo
+                * FAQ for info on why we do this).
+                */
+
+               line->set_x0 (xpos + 0.5);
+               line->set_x1 (xpos + 0.5);
                line->set_y0 (0.0);
                line->set_y1 (_height);
                line->set_outline_color (color);