plugin: fix floating point comparison

Closes #602
This commit is contained in:
2 * r + 2 * t 2025-09-12 12:54:22 +10:00
parent 814831620c
commit 2bd7089310
2 changed files with 2 additions and 2 deletions

View file

@ -54,7 +54,7 @@ void BeatProcessor::process() {
m_collector->readChunk(m_in->data); m_collector->readChunk(m_in->data);
aubio_tempo_do(m_tempo, m_in, m_out); aubio_tempo_do(m_tempo, m_in, m_out);
if (m_out->data[0] != 0.0f) { if (!qFuzzyIsNull(m_out->data[0])) {
emit beat(aubio_tempo_get_bpm(m_tempo)); emit beat(aubio_tempo_get_bpm(m_tempo));
} }
} }

View file

@ -47,7 +47,7 @@ void CUtils::saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, Q
auto scaledRect = rect; auto scaledRect = rect;
const qreal scale = target->window()->devicePixelRatio(); const qreal scale = target->window()->devicePixelRatio();
if (rect.isValid() && scale != 1.0) { if (rect.isValid() && qFuzzyCompare(scale + 1.0, 2.0)) {
scaledRect = scaledRect =
QRectF(rect.left() * scale, rect.top() * scale, rect.width() * scale, rect.height() * scale).toRect(); QRectF(rect.left() * scale, rect.top() * scale, rect.width() * scale, rect.height() * scale).toRect();
} }