diff layer/Colour3DPlotRenderer.cpp @ 1534:bfd8b22fd67c

Fix #1904 Scrolling colour 3d plot does not always work when in View normalisation mode. We shouldn't imagine we've just invalidated the cache if the truth is that we've only just created the renderer
author Chris Cannam
date Wed, 09 Oct 2019 13:45:17 +0100
parents 14a162f6870f
children e95cefd4aa81
line wrap: on
line diff
--- a/layer/Colour3DPlotRenderer.cpp	Wed Oct 09 11:51:19 2019 +0100
+++ b/layer/Colour3DPlotRenderer.cpp	Wed Oct 09 13:45:17 2019 +0100
@@ -133,9 +133,25 @@
 
     sv_frame_t startFrame = v->getStartFrame();
 
+#ifdef DEBUG_COLOUR_PLOT_REPAINT
+    SVDEBUG << "render " << m_sources.source
+            << ": cache size is " << m_cache.getSize().width()
+            << "x" << m_cache.getSize().height()
+            << " at zoom level " << m_cache.getZoomLevel() << endl;
+#endif
+
+    bool justCreated = m_cache.getSize().isEmpty();
+    
     bool justInvalidated =
         (m_cache.getSize() != v->getPaintSize() ||
          m_cache.getZoomLevel() != v->getZoomLevel());
+
+#ifdef DEBUG_COLOUR_PLOT_REPAINT
+    SVDEBUG << "render " << m_sources.source
+            << ": justCreated = " << justCreated
+            << ", justInvalidated = " << justInvalidated
+            << endl;
+#endif
     
     m_cache.resize(v->getPaintSize());
     m_cache.setZoomLevel(v->getZoomLevel());
@@ -303,7 +319,7 @@
 
     } else { // must be DrawBufferPixelResolution, handled DirectTranslucent earlier
 
-        if (timeConstrained && justInvalidated) {
+        if (timeConstrained && !justCreated && justInvalidated) {
             SVDEBUG << "render " << m_sources.source
                     << ": invalidated cache in time-constrained context, that's all we're doing for now - wait for next update to start filling" << endl;
         } else {