no create cached waveview images that span from render-start to cache-start, but...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 19 Apr 2013 14:53:52 +0000 (10:53 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 19 Apr 2013 14:53:52 +0000 (10:53 -0400)
libs/canvas/wave_view.cc

index 257901946f6f3d1b2072e723da9e0b01c84bd210..c6ba816288609b17f53bcbe317a0ed1048cde492 100644 (file)
@@ -174,7 +174,7 @@ WaveView::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) cons
                           need another one for the missing bit.
                        */
 
-                       CacheEntry* c = new CacheEntry (this, p, (*cache)->start());
+                       CacheEntry* c = new CacheEntry (this, p, min (end, (*cache)->start()));
                        cache = _cache.insert (cache, c);
                        ++cache;
                        render = c;
@@ -369,11 +369,7 @@ WaveView::set_region_start (frameoffset_t start)
 /** Construct a new CacheEntry with peak data between two offsets
  *  in the source.
  */
-WaveView::CacheEntry::CacheEntry (
-       WaveView const * wave_view,
-       int start,
-       int end
-       )
+WaveView::CacheEntry::CacheEntry (WaveView const * wave_view, int start, int end)
        : _wave_view (wave_view)
        , _start (start)
        , _end (end)