Skip to content

Commit b0d3726

Browse files
committed
Add a matrix test
1 parent ccd119c commit b0d3726

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

package/src/renderer/__tests__/e2e/Matrix4.spec.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,15 @@ describe("Matrix4", () => {
244244
expect(result).not.toEqual("M150 0L75 200L225 200L150 0Z");
245245
});
246246
it("Path.transform() should accept 4x4 (2)", async () => {
247-
const result = await surface.eval((Skia) => {
247+
let result = await surface.eval((Skia) => {
248+
const path = Skia.Path.MakeFromSVGString("M150 0L75 200L225 200L150 0Z")!;
249+
const m = [1, 0, 0, 100, 0, 1, 0, 100, 0, 0, 1, 0, 0, 0, 0, 1];
250+
path.transform([m[0], m[1], m[3], m[4], m[5], m[7], m[12], m[13], m[15]]);
251+
return path.toSVGString();
252+
});
253+
expect(result).toEqual("M250 100L175 300L325 300L250 100Z");
254+
255+
result = await surface.eval((Skia) => {
248256
const path = Skia.Path.MakeFromSVGString("M150 0L75 200L225 200L150 0Z")!;
249257
path.transform([1, 0, 0, 100, 0, 1, 0, 100, 0, 0, 1, 0, 0, 0, 0, 1]);
250258
return path.toSVGString();

0 commit comments

Comments
 (0)