mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 22:57:36 +00:00
51 lines
2 KiB
HTML
51 lines
2 KiB
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
let testCounter = 1;
|
|
function testPart(part) {
|
|
println(`${testCounter++}. ${JSON.stringify(part())}`);
|
|
}
|
|
|
|
// 1. Creating a DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]));
|
|
|
|
// 2. Creating a DOMMatrix with fromMatrix
|
|
testPart(() => DOMMatrix.fromMatrix({ a: 10, b: 20, c: 30, d: 40, e: 50, f: 60 }));
|
|
|
|
// 3. Multiply DOMMatrix by DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix([10, 20, 30, 40, 50, 60])));
|
|
|
|
// 4. Create translation DOMMatrix
|
|
testPart(() => new DOMMatrix().translate(25, 25));
|
|
|
|
// 5. Translate DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).translateSelf(25, 25));
|
|
|
|
// 6. Translate DOMMatrix with multiply
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix().translate(25, 25)));
|
|
|
|
// 7. Translate DOMMatrix with multiplySelf
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiplySelf(new DOMMatrix().translate(25, 25)));
|
|
|
|
// 8. Translate DOMMatrix with preMultiplySelf
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).preMultiplySelf(new DOMMatrix().translate(25, 25)));
|
|
|
|
// 9. Skew X DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).skewXSelf(10));
|
|
|
|
// 10. Skew X DOMMatrix with multiply
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix().skewX(10)));
|
|
|
|
// 11. Skew Y DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).skewYSelf(10));
|
|
|
|
// 12. Skew Y DOMMatrix with multiply
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).multiply(new DOMMatrix().skewY(10)));
|
|
|
|
// 13. Flip X DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).flipX());
|
|
|
|
// 14. Flip Y DOMMatrix
|
|
testPart(() => new DOMMatrix([10, 20, 30, 40, 50, 60]).flipY());
|
|
});
|
|
</script>
|