# HG changeset patch # User Chris Cannam # Date 1464258115 -3600 # Node ID 38a53c7b81f6364a90480c4aa486ad5ae4b5ae15 # Parent 834e94eb1bca69d909de029705ec3d4b8b7f3204 Don't paint if model has zero width diff -r 834e94eb1bca -r 38a53c7b81f6 layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Thu Apr 21 15:06:05 2016 +0100 +++ b/layer/Colour3DPlotLayer.cpp Thu May 26 11:21:55 2016 +0100 @@ -849,8 +849,12 @@ paint.save(); QFont font = paint.font(); - font.setPixelSize(int(font.pixelSize() * 0.65)); - paint.setFont(font); + if (font.pixelSize() > 0) { + int newSize = int(font.pixelSize() * 0.65); + if (newSize < 6) newSize = 6; + font.setPixelSize(newSize); + paint.setFont(font); + } int msw = paint.fontMetrics().width(maxstr); @@ -1295,6 +1299,14 @@ return; } + if (m_model->getWidth() == 0) { +#ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT + cerr << "Colour3DPlotLayer::paint(): model width == 0, " + << "nothing to paint (yet)" << endl; +#endif + return; + } + if (m_normalizeVisibleArea && !m_normalizeColumns) rect = v->getPaintRect(); sv_frame_t modelStart = m_model->getStartFrame();