# HG changeset patch # User Chris Cannam # Date 1137693551 0 # Node ID 484e7320f59fabfef2f0bc7a5d82149b945308b9 # Parent 2d5005f2b3d9ed7e7004315d2153e2d4af1fbd8c * Add more icons and rationalise menu options to the usual set (on the File menu) * Fixes to import/export of dense 3-D data sets and imported models diff -r 2d5005f2b3d9 -r 484e7320f59f layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Thu Jan 19 12:54:38 2006 +0000 +++ b/layer/Colour3DPlotLayer.cpp Thu Jan 19 17:59:11 2006 +0000 @@ -99,11 +99,20 @@ size_t modelEnd = m_model->getEndFrame(); size_t modelWindow = m_model->getWindowSize(); + size_t cacheWidth = (modelEnd - modelStart) / modelWindow + 1; + size_t cacheHeight = m_model->getYBinCount(); + + if (m_cache && + (m_cache->width() != cacheWidth || + m_cache->height() != cacheHeight)) { + + delete m_cache; + m_cache = 0; + } + if (!m_cache) { - m_cache = new QImage((modelEnd - modelStart) / modelWindow + 1, - m_model->getYBinCount(), - QImage::Format_Indexed8); + m_cache = new QImage(cacheWidth, cacheHeight, QImage::Format_Indexed8); m_cache->setNumColors(256); DenseThreeDimensionalModel::BinValueSet values;