Commit 6d8dbbc

derdilla <82763757+derdilla@users.noreply.github.com>
2024-11-18 08:33:38
Fix warn area appearing somewhere below the value graph line (#488)
1 parent 60fb035
Changed files (1)
app
lib
features
statistics
app/lib/features/statistics/value_graph.dart
@@ -210,8 +210,13 @@ class _ValueGraphPainter extends CustomPainter {
         path = Path();
         path.moveTo(point.dx, point.dy);
 
-        warnPath?.moveTo(_kLeftLegendWidth, warnValue!);
-        warnPath?.lineTo(point.dx, point.dy);
+        // This must not cause #461, #482, or #487.
+        if ((warnValue ?? 0) > point.dy) {
+          warnPath?.moveTo(_kLeftLegendWidth, warnValue!);
+          warnPath?.lineTo(point.dx, point.dy);
+        } else {
+          warnPath?.moveTo(point.dx, point.dy);
+        }
       }
     }