Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
1533:37df1530519d | 1534:bfd8b22fd67c |
---|---|
131 if (x0 < 0) x0 = 0; | 131 if (x0 < 0) x0 = 0; |
132 if (x1 > v->getPaintWidth()) x1 = v->getPaintWidth(); | 132 if (x1 > v->getPaintWidth()) x1 = v->getPaintWidth(); |
133 | 133 |
134 sv_frame_t startFrame = v->getStartFrame(); | 134 sv_frame_t startFrame = v->getStartFrame(); |
135 | 135 |
136 #ifdef DEBUG_COLOUR_PLOT_REPAINT | |
137 SVDEBUG << "render " << m_sources.source | |
138 << ": cache size is " << m_cache.getSize().width() | |
139 << "x" << m_cache.getSize().height() | |
140 << " at zoom level " << m_cache.getZoomLevel() << endl; | |
141 #endif | |
142 | |
143 bool justCreated = m_cache.getSize().isEmpty(); | |
144 | |
136 bool justInvalidated = | 145 bool justInvalidated = |
137 (m_cache.getSize() != v->getPaintSize() || | 146 (m_cache.getSize() != v->getPaintSize() || |
138 m_cache.getZoomLevel() != v->getZoomLevel()); | 147 m_cache.getZoomLevel() != v->getZoomLevel()); |
148 | |
149 #ifdef DEBUG_COLOUR_PLOT_REPAINT | |
150 SVDEBUG << "render " << m_sources.source | |
151 << ": justCreated = " << justCreated | |
152 << ", justInvalidated = " << justInvalidated | |
153 << endl; | |
154 #endif | |
139 | 155 |
140 m_cache.resize(v->getPaintSize()); | 156 m_cache.resize(v->getPaintSize()); |
141 m_cache.setZoomLevel(v->getZoomLevel()); | 157 m_cache.setZoomLevel(v->getZoomLevel()); |
142 | 158 |
143 m_magCache.resize(v->getPaintSize().width()); | 159 m_magCache.resize(v->getPaintSize().width()); |
301 | 317 |
302 renderToCacheBinResolution(v, x0, x1 - x0); | 318 renderToCacheBinResolution(v, x0, x1 - x0); |
303 | 319 |
304 } else { // must be DrawBufferPixelResolution, handled DirectTranslucent earlier | 320 } else { // must be DrawBufferPixelResolution, handled DirectTranslucent earlier |
305 | 321 |
306 if (timeConstrained && justInvalidated) { | 322 if (timeConstrained && !justCreated && justInvalidated) { |
307 SVDEBUG << "render " << m_sources.source | 323 SVDEBUG << "render " << m_sources.source |
308 << ": invalidated cache in time-constrained context, that's all we're doing for now - wait for next update to start filling" << endl; | 324 << ": invalidated cache in time-constrained context, that's all we're doing for now - wait for next update to start filling" << endl; |
309 } else { | 325 } else { |
310 renderToCachePixelResolution(v, x0, x1 - x0, rightToLeft, timeConstrained); | 326 renderToCachePixelResolution(v, x0, x1 - x0, rightToLeft, timeConstrained); |
311 } | 327 } |