From b1d1f1959f41d7b62935d5f08d2754eb768e9ddf Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 5 Aug 2007 12:58:40 +0000 Subject: [PATCH] comparing doubles for equality with == isn't great svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=696628 --- widgets/widget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/widgets/widget.cpp b/widgets/widget.cpp index bcc458527..6821c4183 100644 --- a/widgets/widget.cpp +++ b/widgets/widget.cpp @@ -20,11 +20,13 @@ #include "widget.h" -#include +#include #include #include +#include + #include "layout.h" #include "plasma/plasma.h" @@ -52,7 +54,7 @@ class Widget::Private bool Widget::Private::shouldPaint(QPainter *painter, const QTransform &transform) { qreal zoomLevel = painter->transform().m11() / transform.m11(); - return zoomLevel == scalingFactor(Plasma::DesktopZoom); + return (zoomLevel - scalingFactor(Plasma::DesktopZoom)) < std::numeric_limits::epsilon(); } Widget::Widget(QGraphicsItem *parent)