don't invalidate image cache for every regionr esize, only region start changes
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 25 Apr 2013 13:48:38 +0000 (09:48 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 25 Apr 2013 13:48:38 +0000 (09:48 -0400)
libs/canvas/wave_view.cc

index f39dca7594d7594d1b0c80d0c313067afbb76e8e..ac45c2bc7c34a60100951f6281ea8b1b2f4a0085 100644 (file)
@@ -421,8 +421,17 @@ WaveView::region_resized ()
 
        _pre_change_bounding_box = _bounding_box;
 
-       _region_start = _region->start();
-       invalidate_whole_cache ();
+       frameoffset_t s = _region->start();
+
+       if (s != _region_start) {
+               /* if the region start changes, the information we have 
+                  in the image cache is out of date and not useful
+                  since it will fragmented into little pieces. invalidate
+                  the cache.
+               */
+               _region_start = _region->start();
+               invalidate_whole_cache ();
+       }
 
        _bounding_box_dirty = true;
        compute_bounding_box ();