From deb08d4b148c2f3cb8aa128e523aa5b5d77686f4 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 13 Jun 2012 21:02:25 -0700 Subject: [PATCH] Timeline: Fix disappearing waveforms. --- timeline/src/Audio_Region.C | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/timeline/src/Audio_Region.C b/timeline/src/Audio_Region.C index 4f15728..7b9ed85 100644 --- a/timeline/src/Audio_Region.C +++ b/timeline/src/Audio_Region.C @@ -519,7 +519,13 @@ Audio_Region::draw ( void ) /* calculate waveform offset due to scrolling */ /* offset is the number of frames into the waveform the value of X translates to */ nframes_t x_frame = timeline->xoffset + timeline->x_to_ts( X - _sequence->x() ); - nframes_t offset = x_frame - start(); + nframes_t offset = 0; + + if ( x_frame < start() ) + /* sometimes X is one pixel too soon... */ + offset = 0; + else + offset = x_frame - start(); nframes_t fo = 0; nframes_t ostart = 0, oend = 0;