Fix crossfade height in stacked mode.
[ardour.git] / gtk2_ardour / crossfade_view.cc
index 918f081cdbb0556d90fbca49aa2be6ff23e66305..2854de9a782e865e8bb9995fe26769a0e4f1e8be 100644 (file)
@@ -68,8 +68,6 @@ CrossfadeView::CrossfadeView (ArdourCanvas::Group *parent,
        fade_out->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_CrossfadeLine.get();
        fade_out->property_width_pixels() = 1;
 
-       set_height (get_time_axis_view().current_height());
-
        /* no frame around the xfade or overlap rects */
 
        frame->property_outline_what() = 0;
@@ -108,18 +106,16 @@ CrossfadeView::reset_width_dependent_items (double pixel_width)
 }
 
 void
-CrossfadeView::set_height (double height)
+CrossfadeView::set_height (double h)
 {
-       double h = 0;
-       if (height <= TimeAxisView::hSmaller) {
-               TimeAxisViewItem::set_height (height);
+       if (h <= TimeAxisView::hSmall) {
+               h -= 3.0;
        } else {
-               TimeAxisViewItem::set_height (height - NAME_HIGHLIGHT_SIZE);
+               h -= NAME_HIGHLIGHT_SIZE + 3.0;
        }
 
        TimeAxisViewItem::set_height (h);
 
-       _height = h;
        redraw_curves ();
 }
 
@@ -163,20 +159,6 @@ CrossfadeView::redraw_curves ()
                return;
        }
 
-       /*
-        At "height - 3.0" the bottom of the crossfade touches the name highlight or the bottom of the track (if the
-        track is either Small or Smaller.
-        */
-
-       double tav_height = get_time_axis_view().current_height();
-       
-       if (tav_height == TimeAxisView::hSmaller ||
-           tav_height == TimeAxisView::hSmall) {
-               _height = tav_height - 3.0;
-       } else {
-               _height = tav_height - NAME_HIGHLIGHT_SIZE - 3.0;
-       }
-
        if (_height < 0) {
                /* no space allocated yet */
                return;