Skip to content

Commit

Permalink
gradually "compact" the markers if the waveform height is reduced
Browse files Browse the repository at this point in the history
  • Loading branch information
m0dB authored and m0dB committed Jan 2, 2024
1 parent bff9a30 commit be9e1d9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/waveform/renderers/waveformmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,16 @@ struct MarkerGeometry {
m_labelRect.moveLeft(0.5f);
}

const float increment = std::max<float>(0.f,
m_labelRect.height() + 2.f - std::max(0.f, 80.f - breadth));

Check failure on line 257 in src/waveform/renderers/waveformmark.cpp

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04 (gcc)

conversion from ‘qreal’ {aka ‘double’} to ‘float’ may change value [-Werror=float-conversion]

Check warning on line 257 in src/waveform/renderers/waveformmark.cpp

View workflow job for this annotation

GitHub Actions / coverage

conversion from ‘qreal’ {aka ‘double’} to ‘float’ may change value [-Wfloat-conversion]

if (alignV == Qt::AlignVCenter) {
m_labelRect.moveTop((m_imageSize.height() - m_labelRect.height()) / 2.f);
} else if (alignV == Qt::AlignBottom) {
m_labelRect.moveBottom(m_imageSize.height() - 0.5f -
level * (m_labelRect.height() + 2.f));
level * increment);
} else {
m_labelRect.moveTop(0.5f + level * (m_labelRect.height() + 2.f));
m_labelRect.moveTop(0.5f + level * increment);
}
}
QSize getImageSize(float devicePixelRatio) const {
Expand Down

0 comments on commit be9e1d9

Please sign in to comment.