diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-12 12:54:22 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-12 12:54:22 +1000 |
| commit | 2bd7089310ae9d2eba9428e5d617f0d4d50e94ae (patch) | |
| tree | bbfff9a9435e0397f2f5d30fd81749a13aa64df5 | |
| parent | network: put back the ":" in SSIDs (#601) (diff) | |
| download | caelestia-shell-2bd7089310ae9d2eba9428e5d617f0d4d50e94ae.tar.gz caelestia-shell-2bd7089310ae9d2eba9428e5d617f0d4d50e94ae.tar.bz2 caelestia-shell-2bd7089310ae9d2eba9428e5d617f0d4d50e94ae.zip | |
plugin: fix floating point comparison
Closes #602
| -rw-r--r-- | plugin/src/Caelestia/beattracker.cpp | 2 | ||||
| -rw-r--r-- | plugin/src/Caelestia/cutils.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/plugin/src/Caelestia/beattracker.cpp b/plugin/src/Caelestia/beattracker.cpp index 501739f..462abb8 100644 --- a/plugin/src/Caelestia/beattracker.cpp +++ b/plugin/src/Caelestia/beattracker.cpp @@ -54,7 +54,7 @@ void BeatProcessor::process() { m_collector->readChunk(m_in->data); 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)); } } diff --git a/plugin/src/Caelestia/cutils.cpp b/plugin/src/Caelestia/cutils.cpp index 5608eeb..e93a590 100644 --- a/plugin/src/Caelestia/cutils.cpp +++ b/plugin/src/Caelestia/cutils.cpp @@ -47,7 +47,7 @@ void CUtils::saveItem(QQuickItem* target, const QUrl& path, const QRect& rect, Q auto scaledRect = rect; const qreal scale = target->window()->devicePixelRatio(); - if (rect.isValid() && scale != 1.0) { + if (rect.isValid() && qFuzzyCompare(scale + 1.0, 2.0)) { scaledRect = QRectF(rect.left() * scale, rect.top() * scale, rect.width() * scale, rect.height() * scale).toRect(); } |