no create cached waveview images that span from render-start to cache-start, but always clamp the end to render-end, to avoid creating over-sized images

This commit is contained in:
Paul Davis 2013-04-19 10:53:52 -04:00
parent e55ed5d642
commit 0c170b0897

View file

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