From 7d5a59cf418df868df33ec93124094aa08eaddc1 Mon Sep 17 00:00:00 2001 From: Diadlo Date: Mon, 22 Jan 2018 17:11:17 +0300 Subject: [PATCH] refactor: Use qFuzzyCompare to compare float values Thanks @BiTOk for this tip --- src/video/videosurface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/videosurface.cpp b/src/video/videosurface.cpp index e95616e08..a1b0a6b46 100644 --- a/src/video/videosurface.cpp +++ b/src/video/videosurface.cpp @@ -150,7 +150,7 @@ void VideoSurface::onNewFrameAvailable(const std::shared_ptr& newFra float newRatio = getSizeRatio(newSize); - if (qAbs(newRatio - ratio) > 1E-3 && isVisible()) { + if (!qFuzzyCompare(newRatio, ratio) && isVisible()) { ratio = newRatio; recalulateBounds(); emit ratioChanged();