added checks to mitigate floating point crashes

This commit is contained in:
fourtf
2020-04-19 21:05:40 +02:00
parent 6b512d1052
commit 6052846bc3
12 changed files with 74 additions and 40 deletions
+2 -2
View File
@@ -104,12 +104,12 @@ QRect BaseWindow::getBounds()
float BaseWindow::scale() const
{
return this->overrideScale().value_or(this->scale_);
return std::max<float>(0.01f, this->overrideScale().value_or(this->scale_));
}
float BaseWindow::qtFontScale() const
{
return this->scale() / this->nativeScale_;
return this->scale() / std::max<float>(0.01, this->nativeScale_);
}
void BaseWindow::init()