[skwasm] Fix implementation of SkwasmPath.relativeLineTo (#57201)
Fixes https://github.com/flutter/flutter/issues/157161
diff --git a/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/path.dart b/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/path.dart
index 44950c2..7e08092 100644
--- a/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/path.dart
+++ b/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/path.dart
@@ -50,7 +50,7 @@
void lineTo(double x, double y) => pathLineTo(handle, x, y);
@override
- void relativeLineTo(double x, double y) => pathRelativeMoveTo(handle, x, y);
+ void relativeLineTo(double x, double y) => pathRelativeLineTo(handle, x, y);
@override
void quadraticBezierTo(double x1, double y1, double x2, double y2) =>
diff --git a/lib/web_ui/test/ui/path_test.dart b/lib/web_ui/test/ui/path_test.dart
index 94094a0..03c15fc 100644
--- a/lib/web_ui/test/ui/path_test.dart
+++ b/lib/web_ui/test/ui/path_test.dart
@@ -239,4 +239,13 @@
expect(newFirstMetric.extractPath(4.0, 10.0).computeMetrics().first.length, 6.0);
// TODO(hterkelsen): isClosed always returns false in the HTML renderer, https://github.com/flutter/flutter/issues/114446
}, skip: isHtml);
+
+ test('path relativeLineTo', () {
+ final p = Path();
+ p.moveTo(100, 100);
+ p.relativeLineTo(-50, -50);
+ p.relativeLineTo(100, 0);
+ p.relativeLineTo(-50, 50);
+ expect(p.getBounds(), equals(const Rect.fromLTRB(50.0, 50.0, 150.0, 100.0)));
+ });
}