# HG changeset patch # User Chris Cannam # Date 1570625117 -3600 # Node ID bfd8b22fd67cf609d46f5d20a9bfe23a02128d12 # Parent 37df1530519defcc2e52deb9f4e5d210fe17de81 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 diff -r 37df1530519d -r bfd8b22fd67c layer/Colour3DPlotRenderer.cpp --- 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 {