From 3eaf6a55d82228aac0486fbbcd99ba09a05cbea1 Mon Sep 17 00:00:00 2001 From: Antonio Napolitano Date: Fri, 24 Mar 2023 00:12:05 +0100 Subject: [PATCH] Revert "Merge pull request #4804 from ronso0/waveform-tiny-range-fix" This reverts commit 8facfb6075d62efb8944ae2fc22399f38d2d0ef8, reversing changes made to 690e776a10ecc9155fd8f8692bec12065d4c9a36. --- src/waveform/renderers/waveformrendermarkrange.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/waveform/renderers/waveformrendermarkrange.cpp b/src/waveform/renderers/waveformrendermarkrange.cpp index bf5e5da4fdc0..a6761c5f6e62 100644 --- a/src/waveform/renderers/waveformrendermarkrange.cpp +++ b/src/waveform/renderers/waveformrendermarkrange.cpp @@ -64,10 +64,6 @@ void WaveformRenderMarkRange::draw(QPainter *painter, QPaintEvent * /*event*/) { double startPosition = m_waveformRenderer->transformSamplePositionInRendererWorld(startSample); double endPosition = m_waveformRenderer->transformSamplePositionInRendererWorld(endSample); - // The painter would extend the rectangle to the entire width while - // span is < 1 AND span != 0.25 * [1;3], i.e. works with span = [.25; 0.75] px - // TODO(xxx) Figure what's wrong with QPainter / the renderer - const double span = std::max(endPosition - startPosition, 1.0); //range not in the current display if (startPosition > m_waveformRenderer->getLength() || endPosition < 0) { @@ -82,9 +78,9 @@ void WaveformRenderMarkRange::draw(QPainter *painter, QPaintEvent * /*event*/) { // this shouldn't involve *any* scaling it should be fast even in software mode QRectF rect; if (m_waveformRenderer->getOrientation() == Qt::Horizontal) { - rect.setRect(startPosition, 0, span, m_waveformRenderer->getHeight()); + rect.setRect(startPosition, 0, endPosition - startPosition, m_waveformRenderer->getHeight()); } else { - rect.setRect(0, startPosition, m_waveformRenderer->getWidth(), span); + rect.setRect(0, startPosition, m_waveformRenderer->getWidth(), endPosition - startPosition); } painter->drawImage(rect, *selectedImage, rect); }