Remove unused variable and the accessor methods for it from ARDOUR_UI
[ardour.git] / gtk2_ardour / time_axis_view_item.cc
index 37daaf9eccd1045ffc2ab9338768a94748b3e026..0e66ab2bae2b1372344f565c1572471e7a97df30 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include <pbd/error.h>
+#include <pbd/stacktrace.h>
 
 #include <ardour/types.h>
 #include <ardour/ardour.h>
@@ -566,15 +567,16 @@ TimeAxisViewItem::set_name_text(const ustring& new_name)
 }
 
 /**
- * Set the height of this item
+ * Set the y position and height of this item.
  *
+ * @param y the new y position
  * @param h the new height
  */            
 void
-TimeAxisViewItem::set_height(double height)
+TimeAxisViewItem::set_y_position_and_height (double y, double h)
 {
        if (name_highlight) {
-               if (height < NAME_HIGHLIGHT_THRESH) {
+               if (h < NAME_HIGHLIGHT_THRESH) {
                        name_highlight->hide();
                        if (name_text) {
                                name_text->hide();
@@ -586,20 +588,20 @@ TimeAxisViewItem::set_height(double height)
                        }
                }
 
-               if (height > NAME_HIGHLIGHT_SIZE) {
-                       name_highlight->property_y1() = (double) height+1 - NAME_HIGHLIGHT_SIZE;
-                       name_highlight->property_y2() = (double) height;
+               if (h > NAME_HIGHLIGHT_SIZE) {
+                       name_highlight->property_y1() = (double) y + h + 1 - NAME_HIGHLIGHT_SIZE;
+                       name_highlight->property_y2() = (double) y + h;
                }
                else {
                        /* it gets hidden now anyway */
-                       name_highlight->property_y1() = (double) 1.0;
-                       name_highlight->property_y2() = (double) height;
+                       name_highlight->property_y1() = (double) y;
+                       name_highlight->property_y2() = (double) y + h;
                }
        }
 
        if (name_text) {
-               name_text->property_y() = height+1 - NAME_Y_OFFSET;
-               if (height < NAME_HIGHLIGHT_THRESH) {
+               name_text->property_y() = y + h + 1 - NAME_Y_OFFSET;
+               if (h < NAME_HIGHLIGHT_THRESH) {
                        name_text->property_fill_color_rgba() =  fill_color;
                }
                else {
@@ -608,10 +610,12 @@ TimeAxisViewItem::set_height(double height)
        }
 
        if (frame) {
-               frame->property_y2() = height+1;
+               frame->property_y1() = y;
+               frame->property_y2() = y + h + 1;
        }
 
-       vestigial_frame->property_y2() = height+1;
+       vestigial_frame->property_y1() = y;
+       vestigial_frame->property_y2() = y + h + 1;
 }
 
 /**
@@ -975,8 +979,7 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
        }
 
        if (n == 0) {
-               /* nothing will fit */
-               name_text->hide ();
+               name_text->property_text() = "";
                last_name_text_width = pixel_width;
                return;
        }