Mercurial > hg > svgui
comparison layer/SliceLayer.cpp @ 1387:bca9870301b7 spectrogramparam
Small speedups
author | Chris Cannam |
---|---|
date | Mon, 12 Nov 2018 14:48:42 +0000 |
parents | fc3d89f88690 |
children | 1eb560b363e7 |
comparison
equal
deleted
inserted
replaced
1386:fc3d89f88690 | 1387:bca9870301b7 |
---|---|
400 rect.width(), m_scalePoints[i] * ratio); | 400 rect.width(), m_scalePoints[i] * ratio); |
401 } | 401 } |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
405 int mh = m_sliceableModel->getHeight(); | |
406 | |
405 if (m_plotStyle == PlotBlocks) { | 407 if (m_plotStyle == PlotBlocks) { |
406 // Must use actual zero-width pen, too slow otherwise | 408 // Must use actual zero-width pen, too slow otherwise |
407 paint.setPen(QPen(getBaseQColor(), 0)); | 409 paint.setPen(QPen(getBaseQColor(), 0)); |
408 } else { | 410 } else { |
409 paint.setPen(PaintAssistant::scalePen(getBaseQColor())); | 411 // Similarly, if there are very many bins here, let's drop to |
412 // a precise 1-pixel-width pen | |
413 if (mh > 10000) { | |
414 paint.setPen(QPen(getBaseQColor(), 1)); | |
415 } else { | |
416 paint.setPen(PaintAssistant::scalePen(getBaseQColor())); | |
417 } | |
410 } | 418 } |
411 | 419 |
412 int xorigin = getVerticalScaleWidth(v, true, paint) + 1; | 420 int xorigin = getVerticalScaleWidth(v, true, paint) + 1; |
413 m_xorigins[v->getId()] = xorigin; // for use in getFeatureDescription | 421 m_xorigins[v->getId()] = xorigin; // for use in getFeatureDescription |
414 | 422 |
421 | 429 |
422 if (h <= 0) return; | 430 if (h <= 0) return; |
423 | 431 |
424 QPainterPath path; | 432 QPainterPath path; |
425 | 433 |
426 int mh = m_sliceableModel->getHeight(); | |
427 int bin0 = 0; | 434 int bin0 = 0; |
428 | 435 |
429 if (m_maxbin > m_minbin) { | 436 if (m_maxbin > m_minbin) { |
430 mh = m_maxbin - m_minbin; | 437 mh = m_maxbin - m_minbin; |
431 bin0 = m_minbin; | 438 bin0 = m_minbin; |