[nightcolor] Fix division by zero
Summary: If qAbs(targetTemp - m_currentTemp) is less than TEMPERATURE_STEP, then it will result in a division by zero. FIXED-IN: 5.17.5 BUG: 415359 Reviewers: #kwin, apol Reviewed By: apol Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D26493icc-effect-5.17.5
parent
92817c5ac6
commit
5646c781c8
|
@ -408,7 +408,7 @@ void Manager::resetSlowUpdateTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// calculate interval such as temperature is changed by TEMPERATURE_STEP K per timer timeout
|
// calculate interval such as temperature is changed by TEMPERATURE_STEP K per timer timeout
|
||||||
int interval = availTime / (qAbs(targetTemp - m_currentTemp) / TEMPERATURE_STEP);
|
int interval = availTime * TEMPERATURE_STEP / qAbs(targetTemp - m_currentTemp);
|
||||||
if (interval == 0) {
|
if (interval == 0) {
|
||||||
interval = 1;
|
interval = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue