Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/web_ui/lib/src/engine/skwasm/skwasm_impl/path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SkwasmPath extends SkwasmObjectWrapper<RawPath> implements ScenePath {
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) =>
Expand Down
9 changes: 9 additions & 0 deletions lib/web_ui/test/ui/path_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,13 @@ Future<void> testMain() async {
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)));
});
}
Loading