From ba26316857ddb70bd34f2c14d05932c8729c9d84 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 31 Oct 2013 15:39:29 -0400 Subject: [PATCH] make region fade in/out curve shapes into PolyLines not Polygons so that they don't close the stroke path at the top/bottom --- gtk2_ardour/audio_region_view.cc | 58 +++++--------------------------- gtk2_ardour/audio_region_view.h | 6 ++-- 2 files changed, 11 insertions(+), 53 deletions(-) diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 55f5a3f3af..7d45e8c262 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -159,14 +159,14 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd) create_waves (); - fade_in_shape = new ArdourCanvas::Polygon (group); + fade_in_shape = new ArdourCanvas::PolyLine (group); CANVAS_DEBUG_NAME (fade_in_shape, string_compose ("fade in shape for %1", region()->name())); - fade_in_shape->set_fill_color (fade_color); + fade_in_shape->set_outline_color (fade_color); fade_in_shape->set_data ("regionview", this); - fade_out_shape = new ArdourCanvas::Polygon (group); + fade_out_shape = new ArdourCanvas::PolyLine (group); CANVAS_DEBUG_NAME (fade_out_shape, string_compose ("fade out shape for %1", region()->name())); - fade_out_shape->set_fill_color (fade_color); + fade_out_shape->set_outline_color (fade_color); fade_out_shape->set_data ("regionview", this); if (!_recregion) { @@ -315,10 +315,10 @@ AudioRegionView::fade_in_active_changed () { if (audio_region()->fade_in_active()) { /* XXX: make a themable colour */ - fade_in_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 90)); + fade_in_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 90)); } else { /* XXX: make a themable colour */ - fade_in_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 20)); + fade_in_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 20)); } } @@ -327,10 +327,10 @@ AudioRegionView::fade_out_active_changed () { if (audio_region()->fade_out_active()) { /* XXX: make a themable colour */ - fade_out_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 90)); + fade_out_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 90)); } else { /* XXX: make a themable colour */ - fade_out_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 20)); + fade_out_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 20)); } } @@ -584,26 +584,6 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr ar, f redraw_start_xfade_to (ar, width, points, effective_height); - /* add 3 more points */ - - points.push_back (Duple()); - points.push_back (Duple()); - points.push_back (Duple()); - - /* fold back */ - - points[pi].x = pwidth; - points[pi].y = 2; - pi++; - - points[pi].x = 1; - points[pi].y = 2; - pi++; - - /* connect the dots ... */ - - points[pi] = points[0]; - fade_in_shape->set (points); /* ensure trim handle stays on top */ @@ -682,28 +662,6 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr ar, redraw_end_xfade_to (ar, width, points, effective_height); - /* fill the polygon*/ - - /* add 3 more points */ - - points.push_back (Duple()); - points.push_back (Duple()); - points.push_back (Duple()); - - /* fold back */ - - points[pi].x = _pixel_width; - points[pi].y = effective_height; - pi++; - - points[pi].x = _pixel_width; - points[pi].y = 2; - pi++; - - /* connect the dots ... */ - - points[pi] = points[0]; - fade_out_shape->set (points); /* ensure trim handle stays on top */ diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h index 353d0dc937..bb5cbf29c4 100644 --- a/gtk2_ardour/audio_region_view.h +++ b/gtk2_ardour/audio_region_view.h @@ -150,9 +150,9 @@ class AudioRegionView : public RegionView std::list > feature_lines; - ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position - ArdourCanvas::Polygon* fade_in_shape; - ArdourCanvas::Polygon* fade_out_shape; + ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position + ArdourCanvas::PolyLine* fade_in_shape; + ArdourCanvas::PolyLine* fade_out_shape; ArdourCanvas::Rectangle* fade_in_handle; ///< fade in handle, or 0 ArdourCanvas::Rectangle* fade_out_handle; ///< fade out handle, or 0