# HG changeset patch # User Chris Cannam # Date 1200335166 0 # Node ID d3ee7524d39b09b342e0783146bfd17992b1b2f6 # Parent 8f01867cc191772ad8c1d162a5e98fedcd33bb23 * fix colour 3d plot layer mis-rendering bug -- but I think it's still using dense mode when it shouldn't be (for similarity matrix) diff -r 8f01867cc191 -r d3ee7524d39b layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Fri Jan 11 18:19:50 2008 +0000 +++ b/layer/Colour3DPlotLayer.cpp Mon Jan 14 18:26:06 2008 +0000 @@ -584,12 +584,15 @@ if (int(m_model->getHeight()) >= v->height() || int(modelResolution) < v->getZoomLevel() / 2) { +#ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT + std::cerr << "Colour3DPlotLayer::paint: height = "<< m_model->getHeight() << ", resolution = " << modelResolution << ", model rate = " << m_model->getSampleRate() << ", calling paintDense" << std::endl; +#endif paintDense(v, paint, rect); return; } #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT - std::cerr << "Colour3DPlotLayer::paint: w " << w << ", h " << h << ", sx0 " << sx0 << ", sx1 " << sx1 << ", sw " << sw << ", sh " << sh << std::endl; + std::cerr << "Colour3DPlotLayer::paint: w " << x1-x0 << ", h " << h << ", sx0 " << sx0 << ", sx1 " << sx1 << ", sw " << sx1-sx0 << ", sh " << sh << std::endl; std::cerr << "Colour3DPlotLayer: sample rate is " << m_model->getSampleRate() << ", resolution " << m_model->getResolution() << std::endl; #endif @@ -695,7 +698,7 @@ for (int x = x0; x < x1; ++x) { - long xf = long(v->getFrameForX(x) / srRatio); + long xf = long(v->getFrameForX(x)); if (xf < 0) { for (int y = 0; y < h; ++y) { img.setPixel(x - x0, y, m_cache->color(0)); @@ -703,6 +706,8 @@ continue; } + xf /= srRatio; + float sx0 = (float(xf) - modelStart) / modelResolution; float sx1 = (float(v->getFrameForX(x+1) / srRatio) - modelStart) / modelResolution;