summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-11-07 08:35:26 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-11-07 12:58:56 -0500
commit44873d23e10cdf8446f16ba6d535510d235713d4 (patch)
treef698f57fbdfeb4560aed80423ed73064424d6a67 /gtk2_ardour/time_axis_view_item.cc
parent87cd481a7d11de93b2fc5c53a9070bef7d8c10de (diff)
don't created vestigial frame canvas item for TimeAxisViewItem unless actually needed.
They don't cost very much but there's just really no point cluttering up the scene graph with generally invisible and insensitive items
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.cc')
-rw-r--r--gtk2_ardour/time_axis_view_item.cc25
1 files changed, 16 insertions, 9 deletions
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index ffd9a6d202..f834164f38 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -185,17 +185,12 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
wide_enough_for_name = wide;
high_enough_for_name = high;
rect_visible = true;
+ vestigial_frame = 0;
if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl;
}
- vestigial_frame = new ArdourCanvas::TimeRectangle (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->hide ();
- vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_VestigialFrame());
- vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_VestigialFrame());
-
if (visibility & ShowFrame) {
frame = new ArdourCanvas::TimeRectangle (group,
ArdourCanvas::Rect (0.0, 0.0,
@@ -616,8 +611,10 @@ TimeAxisViewItem::set_height (double height)
}
}
- vestigial_frame->set_y0 (1.0);
- vestigial_frame->set_y1 (height);
+ if (vestigial_frame) {
+ vestigial_frame->set_y0 (1.0);
+ vestigial_frame->set_y1 (height);
+ }
set_colors ();
}
@@ -912,6 +909,14 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (pixel_width < 2.0) {
if (show_vestigial) {
+
+ if (!vestigial_frame) {
+ vestigial_frame = new ArdourCanvas::TimeRectangle (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()->get_VestigialFrame());
+ vestigial_frame->set_fill_color (ARDOUR_UI::config()->get_VestigialFrame());
+ }
+
vestigial_frame->show();
}
@@ -925,7 +930,9 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
}
} else {
- vestigial_frame->hide();
+ if (vestigial_frame) {
+ vestigial_frame->hide();
+ }
if (frame) {
frame->show();