frontend: Round theme variables with "px" units

This commit is contained in:
Warchamp7
2026-01-14 20:23:02 -05:00
committed by Ryan Foster
parent 1d6f1859ea
commit ce87cfb6a1
+6
View File
@@ -646,6 +646,12 @@ static QString EvalMath(const QHash<QString, OBSThemeVariable> &vars, const OBST
val = d1 < d2 ? d1 : d2;
}
// Round any values with a px suffix. Qt does this anyway for some properties,
// but then will flat out break with decimals for others.
if (val1.suffix == "px" || val2.suffix == "px") {
val = std::roundf(val);
}
bool isInteger = ceill(val) == val;
QString result = QString::number(val, 'f', isInteger ? 0 : -1);