comparing doubles for equality with == isn't great
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=696628
This commit is contained in:
parent
8d7e06a09d
commit
b1d1f1959f
@ -20,11 +20,13 @@
|
||||
|
||||
#include "widget.h"
|
||||
|
||||
#include <KDebug>
|
||||
#include <limits>
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QPainter>
|
||||
|
||||
#include <KDebug>
|
||||
|
||||
#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<double>::epsilon();
|
||||
}
|
||||
|
||||
Widget::Widget(QGraphicsItem *parent)
|
||||
|
Loading…
x
Reference in New Issue
Block a user