width = std::max ((framecnt_t) 64, width);
- double const pwidth = rint(trackview.editor().sample_to_pixel (width));
+ double const pwidth = rint(trackview.editor().sample_to_pixel (width));
+
/* the right edge should be right on the region frame is the pixel
* width is zero. Hence the additional + 1.0 at the end.
*/
- double const handle_right = rint(trackview.editor().sample_to_pixel (_region->length()) + TimeAxisViewItem::RIGHT_EDGE_SHIFT - pwidth);
- double const trim_handle_right = rint(trackview.editor().sample_to_pixel (_region->length()) + TimeAxisViewItem::RIGHT_EDGE_SHIFT);
+ double const handle_right = rint(trackview.editor().sample_to_pixel (_region->length()) - pwidth);
+ double const trim_handle_right = rint(trackview.editor().sample_to_pixel (_region->length()));
/* Put the fade out handle so that its right side is at the end-of-fade line;
*/
double effective_height;
- if (_height >= NAME_HIGHLIGHT_THRESH) {
- effective_height = _height - NAME_HIGHLIGHT_SIZE;
- } else {
- effective_height = _height;
+ effective_height = _height - 1.0;
+
+ if (Config->get_show_name_highlight() && effective_height >= NAME_HIGHLIGHT_THRESH) {
+ effective_height -= NAME_HIGHLIGHT_SIZE;
}
/* points *MUST* be in anti-clockwise order */
double length = list->length();
points.assign (list->size(), Duple());
-
+
for (x = list->begin(), pi = 0; x != list->end(); ++x, ++pi) {
- points[pi].x = 1.0 + _pixel_width - pwidth + (pwidth * ((*x)->when/length));
- points[pi].y = effective_height - ((*x)->value * effective_height);
+ points[pi].x = _pixel_width - pwidth + (pwidth * ((*x)->when/length));
+ points[pi].y = 1.0 + effective_height - ((*x)->value * effective_height);
}
/* draw the line */
start_xfade_rect->set_outline_color (ARDOUR_UI::config()->get_CrossfadeLine());
start_xfade_rect->set_fill (false);
start_xfade_rect->set_outline (false);
- start_xfade_rect->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::RIGHT));
- start_xfade_rect->set_outline_width (0.5);
start_xfade_rect->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_start_xfade_event), start_xfade_rect, this));
start_xfade_rect->set_data ("regionview", this);
}
for (Points::size_type i = 0, pci = 0; i < npoints; ++i, ++pci) {
ArdourCanvas::Duple &p (ipoints[pci]);
/* leave x-axis alone but invert with respect to y-axis */
- p.y = effective_height - points[pci].y;
+ p.y = 1.0 + effective_height - points[pci].y;
}
} else {
for (x = inverse->begin(), pi = 0; x != inverse->end(); ++x, ++pi) {
ArdourCanvas::Duple& p (ipoints[pi]);
- p.x = 1.0 + (rect_width * ((*x)->when/length));
- p.y = effective_height - ((*x)->value * effective_height);
+ p.x = (rect_width * ((*x)->when/length));
+ p.y = 1.0 + effective_height - ((*x)->value * effective_height);
}
}
end_xfade_rect->set_outline_color (ARDOUR_UI::config()->get_CrossfadeLine());
end_xfade_rect->set_fill (false);
end_xfade_rect->set_outline (false);
- end_xfade_rect->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT));
- end_xfade_rect->set_outline_width (0.5);
end_xfade_rect->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_end_xfade_event), end_xfade_rect, this));
end_xfade_rect->set_data ("regionview", this);
}
- end_xfade_rect->set (ArdourCanvas::Rect (rect_edge, 0.0, rect_edge + rect_width + TimeAxisViewItem::RIGHT_EDGE_SHIFT, effective_height));
+ end_xfade_rect->set (ArdourCanvas::Rect (rect_edge, 0.0, rect_edge + rect_width, effective_height));
/* fade in line */
for (x = inverse->begin(), i = 0, pi = 0; x != inverse->end(); ++x, ++pi, ++i) {
ArdourCanvas::Duple& p (ipoints[pi]);
- p.x = 1.0 + (rect_width * ((*x)->when/length)) + rend;
- p.y = effective_height - ((*x)->value * effective_height);
+ p.x = (rect_width * ((*x)->when/length)) + rend;
+ p.y = 1.0 + effective_height - ((*x)->value * effective_height);
}
}
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
const double TimeAxisViewItem::GRAB_HANDLE_TOP = 0.0;
const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 10.0;
-const double TimeAxisViewItem::RIGHT_EDGE_SHIFT = 0.0; // TODO remove, fixed in 3.5-3406-g90872c2, but may need further work.
int TimeAxisViewItem::NAME_HEIGHT;
double TimeAxisViewItem::NAME_Y_OFFSET;
if (visibility & ShowFrame) {
frame = new ArdourCanvas::TimeRectangle (group,
ArdourCanvas::Rect (0.0, 0.0,
- trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT,
+ trackview.editor().sample_to_pixel(duration),
trackview.current_height()));
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
double start = 1.0;
if (visibility & FullWidthNameHighlight) {
- width = trackview.editor().sample_to_pixel(item_duration) + RIGHT_EDGE_SHIFT;
+ width = trackview.editor().sample_to_pixel(item_duration);
} else {
- width = trackview.editor().sample_to_pixel(item_duration) - 2.0 + RIGHT_EDGE_SHIFT;
+ width = trackview.editor().sample_to_pixel(item_duration) - 2.0;
}
name_highlight = new ArdourCanvas::Rectangle (group,
ArdourCanvas::Rect (start,
trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE,
- width - 2.0 + RIGHT_EDGE_SHIFT,
+ width - 2.0,
trackview.current_height() - 1.0));
CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
name_highlight->set_data ("timeaxisviewitem", this);
if (name_highlight && wide_enough_for_name && high_enough_for_name) {
name_highlight->show();
- name_highlight->set (ArdourCanvas::Rect (1.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width+RIGHT_EDGE_SHIFT, (double) _height - 1.0));
+ name_highlight->set (ArdourCanvas::Rect (1.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width, (double) _height - 1.0));
} else {
name_highlight->hide();
CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_VestigialFrame());
vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_VestigialFrame());
+ vestigial_frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT));
}
vestigial_frame->show();
if (frame) {
frame->show();
- frame->set_x1 (pixel_width + RIGHT_EDGE_SHIFT);
+ frame->set_x1 (pixel_width);
if (selection_frame) {
selection_frame->set (frame->get().shrink (1.0));
frame_handle_end->hide();
} else {
frame_handle_start->show();
- frame_handle_end->set_x0 (pixel_width + RIGHT_EDGE_SHIFT - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
- frame_handle_end->set_x1 (pixel_width + RIGHT_EDGE_SHIFT);
+ frame_handle_end->set_x0 (pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH));
+ frame_handle_end->set_x1 (pixel_width);
frame_handle_end->show();
}
}