fail under 2

This commit is contained in:
55nknown 2022-12-25 16:41:57 +01:00
parent 1282a0c87e
commit def7113fcf

View File

@ -229,11 +229,15 @@ Color gradeColor({required BuildContext context, required num value, bool nocolo
var settings = Provider.of<SettingsProvider>(context, listen: false); var settings = Provider.of<SettingsProvider>(context, listen: false);
try { try {
if (value < 2.0) {
valueInt = 1;
} else {
if (value >= value.floor() + settings.rounding / 10) { if (value >= value.floor() + settings.rounding / 10) {
valueInt = value.ceil(); valueInt = value.ceil();
} else { } else {
valueInt = value.floor(); valueInt = value.floor();
} }
}
} catch (_) {} } catch (_) {}
if (nocolor) return AppColors.of(context).text; if (nocolor) return AppColors.of(context).text;