# HG changeset patch # User Chris Cannam # Date 1565703329 -3600 # Node ID 78d9282519b0fdee7691d41591285dce37eb8191 # Parent c5589d94b731a1892c26d50849a477dbb1a8499e Ensure rightCropFrame doesn't end up rounded to the left of the desired end pixel HG Enter commit message. Lines beginning with 'HG:' are removed. diff -r c5589d94b731 -r 78d9282519b0 layer/Colour3DPlotRenderer.cpp --- a/layer/Colour3DPlotRenderer.cpp Fri Aug 09 19:02:51 2019 +0100 +++ b/layer/Colour3DPlotRenderer.cpp Tue Aug 13 14:35:29 2019 +0100 @@ -308,6 +308,7 @@ pr.x(), pr.y(), pr.width(), pr.height()); if (!timeConstrained && (pr != rect)) { + QRect cva = m_cache.getValidArea(); SVCERR << "WARNING: failed to render entire requested rect " << "even when not time-constrained: wanted " << rect.x() << "," << rect.y() << " " @@ -315,6 +316,10 @@ << pr.x() << "," << pr.y() << " " << pr.width() << "x" << pr.height() << ", after request of width " << (x1 - x0) + << endl + << "(cache valid area is " + << cva.x() << "," << cva.y() << " " + << cva.width() << "x" << cva.height() << ")" << endl; } @@ -849,6 +854,9 @@ for (int x = x0 + repaintWidth; ; ++x) { sv_frame_t f = v->getFrameForX(x); if ((f / binResolution) * binResolution == f) { + if (v->getXForFrame(f) < x0 + repaintWidth) { + continue; + } if (rightCropFrame == -1) rightCropFrame = f; else if (x > x0 + repaintWidth + 2) { rightBoundaryFrame = f; @@ -897,8 +905,10 @@ #ifdef DEBUG_COLOUR_PLOT_REPAINT SVDEBUG << "scaling draw buffer from width " << m_drawBuffer.width() - << " to " << (scaledRight - scaledLeft) << " (nb drawBufferWidth = " - << drawBufferWidth << ")" << endl; + << " to " << (scaledRight - scaledLeft) + << " (nb drawBufferWidth = " + << drawBufferWidth << ", attainedWidth = " + << attainedWidth << ")" << endl; #endif QImage scaled = scaleDrawBufferImage @@ -921,9 +931,24 @@ if (sourceLeft < 0) { sourceLeft = 0; } + +#ifdef DEBUG_COLOUR_PLOT_REPAINT + SVDEBUG << "leftBoundaryFrame = " << leftBoundaryFrame + << ", leftCropFrame = " << leftCropFrame + << ", scaledLeft = " << scaledLeft + << ", scaledLeftCrop = " << scaledLeftCrop + << endl; + SVDEBUG << "rightBoundaryFrame = " << rightBoundaryFrame + << ", rightCropFrame = " << rightCropFrame + << ", scaledRight = " << scaledRight + << ", scaledRightCrop = " << scaledRightCrop + << endl; +#endif #ifdef DEBUG_COLOUR_PLOT_REPAINT - SVDEBUG << "repaintWidth = " << repaintWidth + SVDEBUG << "x0 = " << x0 + << ", repaintWidth = " << repaintWidth + << ", targetLeft = " << targetLeft << ", targetWidth = " << targetWidth << endl; #endif