1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:47:35 +00:00

LibWeb: Add DOMMatrix scale and scale3d

This commit is contained in:
Bastiaan van der Plaat 2023-09-07 21:27:34 +02:00 committed by Andrew Kaster
parent 67f6a9ee12
commit 42c2a67c83
8 changed files with 125 additions and 5 deletions

View file

@ -0,0 +1,27 @@
<script src="../include.js"></script>
<script>
test(() => {
let testCounter = 1;
function testPart(part) {
println(`${testCounter++}. ${JSON.stringify(part())}`);
}
// 1. Scale DOMMatrix
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).scale(1, 2, 3));
// 2. Scale DOMMatrix with multiply
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix().scale(1, 2, 3)));
// 3. Scale DOMMatrix with multiply
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]).multiply(new DOMMatrix().scale(1, 2, 3)));
// 4. Scale 3D DOMMatrix
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).scale3d(5, 4, 3, 2));
// 5. Scale 3D DOMMatrix with multiply
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix().scale3d(5, 4, 3, 2)));
// 6. Scale 3D DOMMatrix with multiply
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160]).multiply(new DOMMatrix().scale3d(5, 4, 3, 2)));
});
</script>