summaryrefslogtreecommitdiff
path: root/libs/canvas/wave_view.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-04-19 10:53:52 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-04-19 10:53:52 -0400
commit0c170b08973dd1f50d4c3f527c77a6aa9af6a6ff (patch)
tree57335fa0b8499a9120b90203c92557ab7b4703d3 /libs/canvas/wave_view.cc
parente55ed5d642a13547ef29212472cd4d39c1b8774d (diff)
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
Diffstat (limited to 'libs/canvas/wave_view.cc')
-rw-r--r--libs/canvas/wave_view.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc
index 257901946f..c6ba816288 100644
--- a/libs/canvas/wave_view.cc
+++ b/libs/canvas/wave_view.cc
@@ -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)