(5) debugging with nowhiskey - remove stupid lack of scaling caused by redisplaying...
[ardour.git] / gtk2_ardour / time_axis_view.cc
index d90698db0e760da41c1c0ebcb6449d9fa91ff3ce..325fc6c217df177573e72bd32dc89607e1614858 100644 (file)
@@ -91,7 +91,6 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
        _hidden = false;
        height = 0;
        effective_height = 0;
-       height_scaling_factor = 1.0;
        parent = rent;
        _has_state = false;
        last_name_entry_key_press_event = 0;
@@ -341,13 +340,6 @@ TimeAxisView::hide ()
        Hiding ();
 }
 
-void
-TimeAxisView::set_height_scaling_factor (double hsf)
-{
-       height_scaling_factor = hsf;
-       set_height (height);
-}
-
 void
 TimeAxisView::step_height (bool bigger)
 {
@@ -376,8 +368,9 @@ void
 TimeAxisView::set_height(uint32_t h)
 {
        height = h;
+
        controls_frame.set_size_request (-1, current_height() + ((order == 0) ? 1 : 0));
-       //cerr << "TimeAxisView::set_height_pixels() called h = " << h << endl;//DEBUG
+
        if (canvas_item_visible (selection_group)) {
                /* resize the selection rect */
                show_selection (editor.get_selection().time);
@@ -534,7 +527,6 @@ TimeAxisView::conditionally_add_to_selection ()
        Selection& s (editor.get_selection());
 
        if (!s.selected (this)) {
-               cerr << "set selected track\n";
                editor.set_selected_track (*this, Selection::Set);
        }
 }
@@ -930,8 +922,6 @@ TimeAxisView::get_state ()
 
        snprintf (buf, sizeof(buf), "%u", height);
        node->add_property ("height", buf);
-       snprintf (buf, sizeof(buf), "%f", height_scaling_factor);
-       node->add_property ("height_scaling_factor", buf);
        node->add_property ("marked_for_display", (_marked_for_display ? "1" : "0"));
        return *node;
 }
@@ -945,10 +935,6 @@ TimeAxisView::set_state (const XMLNode& node)
                _marked_for_display = (prop->value() == "1");
        }
 
-       if ((prop = node.property ("height_scaling_factor")) != 0) {
-               height_scaling_factor = atof (prop->value());
-       } 
-
        if ((prop = node.property ("track_height")) != 0) {
 
                if (prop->value() == "largest") {
@@ -1195,6 +1181,7 @@ TimeAxisView::resizer_button_press (GdkEventButton* event)
 {
        resize_drag_start = event->y_root;
        resize_idle_target = current_height();
+       editor.start_resize_line_ops ();
        return true;
 }
 
@@ -1202,6 +1189,7 @@ bool
 TimeAxisView::resizer_button_release (GdkEventButton* ev)
 {
        resize_drag_start = -1;
+       editor.end_resize_line_ops ();
        return true;
 }
 
@@ -1227,11 +1215,18 @@ TimeAxisView::resizer_motion (GdkEventMotion* ev)
        }
 
        int32_t delta = (int32_t) floor (resize_drag_start - ev->y_root);
+       int xroot, yroot;
+       Glib::RefPtr<Gdk::Window> win (resizer.get_window());
+
+       if (win) {
+               win->get_origin (xroot, yroot);
+               editor.queue_draw_resize_line (yroot + ev->y);
+       }
 
        resize_idle_target = std::max (resize_idle_target - delta, (int) hSmall);
 
        if (resize_idle_id < 0) {
-               resize_idle_id = g_idle_add (_idle_resizer, this);
+               // resize_idle_id = g_idle_add (_idle_resizer, this);
        }
 
        resize_drag_start = ev->y_root;
@@ -1239,7 +1234,6 @@ TimeAxisView::resizer_motion (GdkEventMotion* ev)
        return true;
 }
 
-
 bool
 TimeAxisView::resizer_expose (GdkEventExpose* event)
 {