summaryrefslogtreecommitdiff
path: root/gtk2_ardour/audio_region_view.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-02-14 10:21:51 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-02-14 10:21:51 -0500
commit7e34ce96c648fc73c09ca4f9ecb8e198187457f8 (patch)
tree70383569ce6e3d5779ea283e7ec44a6e71c19a82 /gtk2_ardour/audio_region_view.cc
parent1df483d3db901c9c2b9a0adae91756d374f82b22 (diff)
fix up placement of fade out handle
Diffstat (limited to 'gtk2_ardour/audio_region_view.cc')
-rw-r--r--gtk2_ardour/audio_region_view.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index bbe3c87c29..05b797bc94 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -616,10 +616,13 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
width = std::max ((framecnt_t) 64, width);
- /* round here to prevent little visual glitches with sub-pixel placement */
- double const pwidth = rint (width / samples_per_pixel);
+ double const pwidth = 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 = (_region->length() / samples_per_pixel) - pwidth;
+ double const handle_right = trackview.editor().sample_to_pixel (_region->length()) + TimeAxisViewItem::RIGHT_EDGE_SHIFT - pwidth + 1.0;
/* Put the fade out handle so that its right side is at the end-of-fade line;
*/