}
if (visibility & ShowFrame) {
- frame = new ArdourCanvas::TimeRectangle (group,
+ frame = new ArdourCanvas::Rectangle (group,
ArdourCanvas::Rect (0.0, 0.0,
trackview.editor().sample_to_pixel(duration),
trackview.current_height()));
if (ARDOUR_UI::config()->get_show_name_highlight() && (visibility & ShowNameHighlight)) {
- double width;
- double start = 1.0;
-
- if (visibility & FullWidthNameHighlight) {
- width = trackview.editor().sample_to_pixel(item_duration);
- } else {
- 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,
- trackview.current_height() - 1.0));
+ /* rectangle size will be set in ::manage_name_highlight() */
+ name_highlight = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
name_highlight->set_data ("timeaxisviewitem", this);
name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
- name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
+ name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255)); // this should use a theme color
} else {
name_highlight = 0;
}
group->set_x_position (new_unit_pos);
-
PositionChanged (frame_position, src); /* EMIT_SIGNAL */
return true;
item_duration = dur;
- reset_width_dependent_items (trackview.editor().sample_to_pixel (dur));
+ double end_pixel = trackview.editor().sample_to_pixel (frame_position + dur);
+ double first_pixel = trackview.editor().sample_to_pixel (frame_position);
+
+ reset_width_dependent_items (end_pixel - first_pixel);
DurationChanged (dur, src); /* EMIT_SIGNAL */
return true;
if (_selected && frame) {
if (!selection_frame) {
- selection_frame = new ArdourCanvas::TimeRectangle (group);
+ selection_frame = new ArdourCanvas::Rectangle (group);
selection_frame->set_fill (false);
selection_frame->set_outline_color (ARDOUR_UI::config()->color ("selected time axis frame"));
selection_frame->set_ignore_events (true);
name_text_width = pixel_width (new_name, NAME_FONT) + 2;
name_text->set (new_name);
+ manage_name_text ();
}
if (frame) {
- frame->set_y0 (1.0);
+ frame->set_y0 (0.0);
frame->set_y1 (height);
if (frame_handle_start) {
}
if (vestigial_frame) {
- vestigial_frame->set_y0 (1.0);
+ vestigial_frame->set_y0 (0.0);
vestigial_frame->set_y1 (height);
}
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, (double) _height - 1.0));
+ // name_highlight->set_x_position (1.0);
+ name_highlight->set (ArdourCanvas::Rect (0.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width - 2.0, _height));
} else {
name_highlight->hide();
ArdourCanvas::Color
TimeAxisViewItem::get_fill_color () const
{
- ArdourCanvas::Color c;
const std::string mod_name = (_dragging ? "dragging region" : fill_color_name);
if (_selected) {
-
- c = ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
-
- } else {
-
- if (_recregion) {
- c = ARDOUR_UI::config()->color ("recording rect");
- } else {
- if ((!ARDOUR_UI::config()->get_show_name_highlight() || high_enough_for_name) && !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
- c = ARDOUR_UI::config()->color_mod (fill_color_name, mod_name);
- } else {
- c = ARDOUR_UI::config()->color_mod (fill_color, mod_name);
- }
- }
+ return ARDOUR_UI::config()->color_mod ("selected region base", mod_name);
+ } else if (_recregion) {
+ return ARDOUR_UI::config()->color ("recording rect");
+ } else if ((!ARDOUR_UI::config()->get_show_name_highlight() || high_enough_for_name) &&
+ !ARDOUR_UI::config()->get_color_regions_using_track_color()) {
+ return ARDOUR_UI::config()->color_mod (fill_color_name, mod_name);
}
-
- return c;
+ return ARDOUR_UI::config()->color_mod (fill_color, mod_name);
}
/**
{
samples_per_pixel = fpp;
set_position (this->get_position(), this);
- reset_width_dependent_items ((double) get_duration() / samples_per_pixel);
+
+ double end_pixel = trackview.editor().sample_to_pixel (frame_position + get_duration());
+ double first_pixel = trackview.editor().sample_to_pixel (frame_position);
+
+ reset_width_dependent_items (end_pixel - first_pixel);
}
void
if (show_vestigial) {
if (!vestigial_frame) {
- vestigial_frame = new ArdourCanvas::TimeRectangle (group, ArdourCanvas::Rect (0.0, 0.0, 2.0, trackview.current_height()));
+ vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 0.0, 2.0, trackview.current_height()));
CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
vestigial_frame->set_outline_color (ARDOUR_UI::config()->color ("vestigial frame"));
vestigial_frame->set_fill_color (ARDOUR_UI::config()->color ("vestigial frame"));
if (frame) {
frame->show();
+ /* Note: x0 is always zero - the position is defined by
+ * the position of the group, not the frame.
+ */
frame->set_x1 (pixel_width);
if (selection_frame) {