Revert "cont'd work on automation-track headers (amend ba53af1c5)"
authorRobin Gareus <robin@gareus.org>
Thu, 4 Sep 2014 14:14:01 +0000 (16:14 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 4 Sep 2014 14:14:01 +0000 (16:14 +0200)
This reverts commit beb5e3e777b0e92e8dde7ee12c324b32c679ff63.

gtk2_ardour/audio_region_view.cc
gtk2_ardour/automation_time_axis.cc
gtk2_ardour/editor_drag.cc
gtk2_ardour/ghostregion.cc
gtk2_ardour/region_view.cc
gtk2_ardour/streamview.cc
gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view_item.cc

index 8f5371adad957df6bcddaaea7fb6b98855701b2f..6c41272d93e2d3f4819b244ad09509bf1172e8de 100644 (file)
@@ -486,7 +486,7 @@ AudioRegionView::set_height (gdouble height)
                        ht = (((height - 2 * wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
                }
 
-               gdouble yoff = 1 + n * (ht + 1);
+               gdouble yoff = n * (ht + 1);
 
                waves[n]->set_height (ht);
                waves[n]->set_y_position (yoff + 2);
@@ -1132,7 +1132,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
                ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
        }
 
-       gdouble yoff = 1 + which * ht;
+       gdouble yoff = which * ht;
 
        WaveView *wave = new WaveView (group, audio_region ());
        CANVAS_DEBUG_NAME (wave, string_compose ("wave view for chn %1 of %2", which, get_item_name()));
index e22e69a9b24c24271ecfa290b442dbde14bdc499..cec3f3a4909275cd6aa76346a671d3d149938a0e 100644 (file)
@@ -120,7 +120,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        CANVAS_DEBUG_NAME (_base_rect, string_compose ("base rect for %1", _name));
        _base_rect->set_x1 (ArdourCanvas::COORD_MAX);
        _base_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_AutomationTrackOutline());
-       _base_rect->set_outline_what (ArdourCanvas::Rectangle::TOP);
+       _base_rect->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
        _base_rect->set_fill_color (ARDOUR_UI::config()->get_canvasvar_AutomationTrackFill());
        _base_rect->set_data ("trackview", this);
        _base_rect->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_automation_track_event), _base_rect, this));
index c48376b4cbc7a15cad47df38e6a7009a3b4b95b6..eb130c5f294fedd86175379f13103e4bb6c603b8 100644 (file)
@@ -769,7 +769,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
                        if (_brushing) {
                                _editor->mouse_brush_insert_region (rv, pending_region_position);
                        } else {
-                               Duple track_origin (0, 1);
+                               Duple track_origin;
 
                                /* Get the y coordinate of the top of the track that this region is now over */
                                track_origin = current_tv->canvas_display()->item_to_canvas (track_origin);
index 054030b14f5c298d5c9660352f263b9f87056ea6..759ffb94d23a824823f5f8c682c5deda89559093 100644 (file)
@@ -44,7 +44,7 @@ GhostRegion::GhostRegion (ArdourCanvas::Container* parent, TimeAxisView& tv, Tim
 {
        group = new ArdourCanvas::Container (parent);
        CANVAS_DEBUG_NAME (group, "ghost region");
-       group->set_position (ArdourCanvas::Duple (initial_pos, 1));
+       group->set_position (ArdourCanvas::Duple (initial_pos, 0));
 
        base_rect = new ArdourCanvas::Rectangle (group);
        CANVAS_DEBUG_NAME (base_rect, "ghost region rect");
index 6cd0bc3a3e4ae06976fc6d7ab3f84f687a18a1ba..d45164ee4279e1a17d344c30f9f2046d22996aa4 100644 (file)
@@ -675,7 +675,7 @@ RegionView::region_sync_changed ()
                        sync_mark->set (points);
                        sync_mark->show ();
 
-                       sync_line->set (ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, trackview.current_height() - NAME_HIGHLIGHT_SIZE - 1));
+                       sync_line->set (ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, trackview.current_height() - NAME_HIGHLIGHT_SIZE));
                        sync_line->show ();
                }
        }
@@ -748,18 +748,16 @@ RegionView::set_height (double h)
 
                sync_line->set (
                        ArdourCanvas::Duple (offset, 0),
-                       ArdourCanvas::Duple (offset, h - NAME_HIGHLIGHT_SIZE - 1)
+                       ArdourCanvas::Duple (offset, h - NAME_HIGHLIGHT_SIZE)
                        );
        }
 
        for (list<ArdourCanvas::Rectangle*>::iterator i = _coverage_frames.begin(); i != _coverage_frames.end(); ++i) {
-               (*i)->set_y0 (1);
-               (*i)->set_y1 (h);
+               (*i)->set_y1 (h + 1);
        }
 
        for (list<ArdourCanvas::Rectangle*>::iterator i = _silent_frames.begin(); i != _silent_frames.end(); ++i) {
-               (*i)->set_y0 (1);
-               (*i)->set_y1 (h);
+               (*i)->set_y1 (h + 1);
        }
 
 }
@@ -814,7 +812,7 @@ RegionView::update_coverage_frames (LayerDisplay d)
                        _coverage_frames.push_back (cr);
                        cr->set_x0 (trackview.editor().sample_to_pixel (t - position));
                        cr->set_y0 (1);
-                       cr->set_y1 (_height);
+                       cr->set_y1 (_height + 1);
                        cr->set_outline (false);
                        cr->set_ignore_events (true);
                        if (new_me) {
index a6a4b5d007f6d83a9aafc7de25d8e943b9413b70..9eecc80dd7fd80de28ced468cb2bb81c02453a48 100644 (file)
@@ -72,7 +72,7 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Container* canvas_g
        canvas_rect = new ArdourCanvas::Rectangle (_canvas_group);
        CANVAS_DEBUG_NAME (canvas_rect, string_compose ("SV canvas rectangle %1", _trackview.name()));
        canvas_rect->set (ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, tv.current_height ()));
-       canvas_rect->set_outline_what (ArdourCanvas::Rectangle::TOP);
+       canvas_rect->set_outline_what (ArdourCanvas::Rectangle::BOTTOM);
        canvas_rect->set_outline_color (RGBA_TO_UINT (0, 0, 0, 255));
        canvas_rect->set_fill (true);
        canvas_rect->Event.connect (sigc::bind (sigc::mem_fun (_trackview.editor(), &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
@@ -608,7 +608,7 @@ StreamView::update_contents_height ()
                case Stacked:
                case Expanded:
                        /* In stacked displays, the recregion is always at the top */
-                       i->rectangle->set_y0 (1);
+                       i->rectangle->set_y0 (0);
                        i->rectangle->set_y1 (h);
                        break;
                }
index a30e024f9ae1b325374de5d8ea070ffcaa2a4399..ee6208b6812e2ae10b0ad339040ccb4995b873e8 100644 (file)
@@ -280,7 +280,9 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
        _order = nth;
 
        if (_y_position != y) {
-               _canvas_display->set_y_position (y);
+               // XXX +1 is a quick hack to align the track-header with the canvas
+               // with the separator line at the top.
+               _canvas_display->set_y_position (y + 1);
                _y_position = y;
 
        }
@@ -843,9 +845,9 @@ TimeAxisView::hide_timestretch ()
 void
 TimeAxisView::show_selection (TimeSelection& ts)
 {
-       double x0;
        double x1;
-       double y1;
+       double x2;
+       double y2;
        SelectionRect *rect;    time_axis_frame.show();
 
 
@@ -877,17 +879,17 @@ TimeAxisView::show_selection (TimeSelection& ts)
 
                rect = get_selection_rect ((*i).id);
 
-               x0 = _editor.sample_to_pixel (start);
-               x1 = _editor.sample_to_pixel (start + cnt - 1);
-               y1 = current_height();
+               x1 = _editor.sample_to_pixel (start);
+               x2 = _editor.sample_to_pixel (start + cnt - 1);
+               y2 = current_height() - 1;
 
-               rect->rect->set (ArdourCanvas::Rect (x0, 1, x1, y1));
+               rect->rect->set (ArdourCanvas::Rect (x1, 0, x2, y2));
 
                // trim boxes are at the top for selections
 
-               if (x1 > x0) {
-                       rect->start_trim->set (ArdourCanvas::Rect (x0, 1, x0 + trim_handle_size, y1));
-                       rect->end_trim->set (ArdourCanvas::Rect (x1 - trim_handle_size, 1, x1, y1));
+               if (x2 > x1) {
+                       rect->start_trim->set (ArdourCanvas::Rect (x1, 1, x1 + trim_handle_size, y2));
+                       rect->end_trim->set (ArdourCanvas::Rect (x2 - trim_handle_size, 1, x2, y2));
 
                        rect->start_trim->show();
                        rect->end_trim->show();
index a2e38c15590b808cbb2d7460134bee414ad30a02..74651f67f6d1eddd8ad74b4f3539e35d4bde44aa 100644 (file)
@@ -166,7 +166,6 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
        group = new ArdourCanvas::Container (parent);
        CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
        group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
-       group->set_y_position (1);
 
        fill_color = base_color;
        samples_per_pixel = fpp;
@@ -1019,7 +1018,7 @@ TimeAxisViewItem::idle_remove_this_item(TimeAxisViewItem* item, void* src)
 void
 TimeAxisViewItem::set_y (double y)
 {
-       group->set_y_position (y + 1);
+       group->set_y_position (y);
 }
 
 void