forked from firka/flutter
[skwasm] Fix implementation of SkwasmPath.relativeLineTo (flutter/engine#57201)
Fixes https://github.com/flutter/flutter/issues/157161
This commit is contained in:
@@ -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) =>
|
||||
|
||||
@@ -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)));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user