diff options
Diffstat (limited to 'src/waveform')
-rw-r--r-- | src/waveform/renderers/waveformrendermark.cpp | 8 | ||||
-rw-r--r-- | src/waveform/renderers/waveformrendermark.h | 1 | ||||
-rw-r--r-- | src/waveform/waveformmarklabel.h | 4 |
3 files changed, 9 insertions, 4 deletions
diff --git a/src/waveform/renderers/waveformrendermark.cpp b/src/waveform/renderers/waveformrendermark.cpp index f46ed5e071..882b748f1a 100644 --- a/src/waveform/renderers/waveformrendermark.cpp +++ b/src/waveform/renderers/waveformrendermark.cpp @@ -60,7 +60,7 @@ void WaveformRenderMark::draw(QPainter* painter, QPaintEvent* /*event*/) { if (samplePosition != -1.0) { double currentMarkPoint = m_waveformRenderer->transformSamplePositionInRendererWorld(samplePosition); - const auto& labelBoundingRect = m_markBoundaries[pMark]; + const auto& labelBoundingRect = pMark->m_label.area(); if (m_waveformRenderer->getOrientation() == Qt::Horizontal) { // NOTE: vRince I guess image width is odd to display the center on the exact line ! // external image should respect that ... @@ -235,8 +235,10 @@ void WaveformRenderMark::generateMarkImage(WaveformMarkPointer pMark) { labelRect.moveBottom(height - 1); } - m_markBoundaries[pMark].setRect( - labelRect.left(), labelRect.top(), labelRectWidth, labelRectHeight); + pMark->m_label.setAreaRect(QRectF(labelRect.left(), + labelRect.top(), + labelRectWidth, + labelRectHeight)); // Fill with transparent pixels pMark->m_image.fill(QColor(0, 0, 0, 0).rgba()); diff --git a/src/waveform/renderers/waveformrendermark.h b/src/waveform/renderers/waveformrendermark.h index bccc5691af..dc0fad17c9 100644 --- a/src/waveform/renderers/waveformrendermark.h +++ b/src/waveform/renderers/waveformrendermark.h @@ -36,7 +36,6 @@ class WaveformRenderMark : public QObject, public WaveformRendererAbstract { void generateMarkImage(WaveformMarkPointer pMark); WaveformMarkSet m_marks; - QMap<WaveformMarkPointer, QRect> m_markBoundaries; DISALLOW_COPY_AND_ASSIGN(WaveformRenderMark); }; diff --git a/src/waveform/waveformmarklabel.h b/src/waveform/waveformmarklabel.h index 02ff40ca79..fa3bcdee22 100644 --- a/src/waveform/waveformmarklabel.h +++ b/src/waveform/waveformmarklabel.h @@ -27,6 +27,10 @@ class WaveformMarkLabel { return m_areaRect; }; + inline void setAreaRect(const QRectF& areaRect) { + m_areaRect = areaRect; + } + bool intersects(const QRectF& other) const { return m_areaRect.intersects(other); } |