Skip to content

Commit

Permalink
Fix start of warn area not filled at specific angles (#490)
Browse files Browse the repository at this point in the history
* Fix missing start area at specific angles

* update test for horizontal homepage graph
  • Loading branch information
derdilla authored Nov 22, 2024
1 parent 6d8dbbc commit e9c0024
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/lib/features/statistics/value_graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class _ValueGraphPainter extends CustomPainter {
double maxY,
double? warnValue,
) {
if (data.isEmpty) return;
if (data.length < 2) return;

Path? path;
Path? warnPath = warnValue == null ? null : Path();
Expand Down Expand Up @@ -228,6 +228,7 @@ class _ValueGraphPainter extends CustomPainter {

warnPath = subPath(warnPath!, progress);
warnPath.relativeLineTo(0, size.height);
warnPath.lineTo(_kLeftLegendWidth, size.height);

final y = _transformY(size, warnValue, minY, maxY);

Expand Down
4 changes: 3 additions & 1 deletion app/test/screens/home_screen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ void main() {
await tester.pumpAndSettle();

expect(find.byType(BloodPressureValueGraph), findsOneWidget);
expect(find.byType(SafeArea), findsAtLeast(1));
expect(find.byType(Scaffold), findsAtLeast(1));
expect(find.byType(NavigationActionButtons), findsNothing);
expect(find.byType(IntervalPicker), findsNothing);
expect(find.byType(IntervalPicker), findsOneWidget);
expect(find.byType(MeasurementList), findsNothing);
});

Expand Down

0 comments on commit e9c0024

Please sign in to comment.