summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-09-03 19:58:33 +0200
committerRobin Gareus <robin@gareus.org>2014-09-03 20:48:20 +0200
commitbeb5e3e777b0e92e8dde7ee12c324b32c679ff63 (patch)
tree4e805fb856a579f6eeff5e5f6f933e379e7e7187 /gtk2_ardour/time_axis_view.cc
parent0ea1238479c9692a2b212cc226b783dce4f1e3c6 (diff)
cont'd work on automation-track headers (amend ba53af1c5)
now that the separator line is at the top, offset region-contents y0 by 1px.
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r--gtk2_ardour/time_axis_view.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index 673488acb5..31b5e2f145 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -280,9 +280,7 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
_order = nth;
if (_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);
+ _canvas_display->set_y_position (y);
_y_position = y;
}
@@ -845,9 +843,9 @@ TimeAxisView::hide_timestretch ()
void
TimeAxisView::show_selection (TimeSelection& ts)
{
+ double x0;
double x1;
- double x2;
- double y2;
+ double y1;
SelectionRect *rect; time_axis_frame.show();
@@ -879,17 +877,17 @@ TimeAxisView::show_selection (TimeSelection& ts)
rect = get_selection_rect ((*i).id);
- x1 = _editor.sample_to_pixel (start);
- x2 = _editor.sample_to_pixel (start + cnt - 1);
- y2 = current_height() - 1;
+ x0 = _editor.sample_to_pixel (start);
+ x1 = _editor.sample_to_pixel (start + cnt - 1);
+ y1 = current_height();
- rect->rect->set (ArdourCanvas::Rect (x1, 0, x2, y2));
+ rect->rect->set (ArdourCanvas::Rect (x0, 1, x1, y1));
// trim boxes are at the top for selections
- 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));
+ 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));
rect->start_trim->show();
rect->end_trim->show();