Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a96028fd authored by Frederik Gladhorn's avatar Frederik Gladhorn

Use fuzzy compare for floats

Reviewers: #plasma, broulik

Reviewed By: #plasma, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D14352
parent cd72e176
......@@ -316,7 +316,7 @@ void WaylandConfig::applyConfig(const KScreen::ConfigPtr &newConfig)
wlOutputConfiguration->setPosition(o_old->outputDevice(), output->pos());
}
if (device->scale() != output->scale()) {
if (!qFuzzyCompare(device->scale(), output->scale())) {
changed = true;
wlOutputConfiguration->setScale(o_old->outputDevice(), output->scale());
}
......
......@@ -120,7 +120,7 @@ float Mode::refreshRate() const
void Mode::setRefreshRate(float refresh)
{
if (d->rate == refresh) {
if (qFuzzyCompare(d->rate, refresh)) {
return;
}
......
......@@ -108,7 +108,7 @@ bool Output::Private::compareModeList(const ModeList& before, const ModeList &af
if (mb->size() != ma->size()) {
return false;
}
if (mb->refreshRate() != ma->refreshRate()) {
if (!qFuzzyCompare(mb->refreshRate(), ma->refreshRate())) {
return false;
}
if (mb->name() != ma->name()) {
......@@ -387,7 +387,7 @@ qreal Output::scale() const
void Output::setScale(qreal factor)
{
if (d->scale == factor) {
if (qFuzzyCompare(d->scale, factor)) {
return;
}
d->scale = factor;
......@@ -527,7 +527,7 @@ void Output::apply(const OutputPtr& other)
changes << &Output::rotationChanged;
setRotation(other->d->rotation);
}
if (d->scale != other->d->scale) {
if (!qFuzzyCompare(d->scale, other->d->scale)) {
changes << &Output::scaleChanged;
setScale(other->d->scale);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment