Most appropriate sub-area of p5.js?
p5.js version
2.3.2
Web browser and version
No response
Operating system
macOS 15.7.3
Steps to reproduce this
Steps:
- Add the regression test below to the
<defs> and <use> elements suite in test/unit/svg/svg_import.js.
- Run
npm test -- test/unit/svg/svg_import.js.
- Observe that the test fails because
node.state.transform.a is 1 instead of the expected 2.
The test uses a 100×100 <symbol> with preserveAspectRatio="none" inside a 200×100 <use> viewport. In this case, the expected transform is non-uniform scaling: 2× horizontally and 1× vertically.
I reproduced this on p5.js 2.3.2 (main at 7f9e0fda5). The SVG importer test suite reports 92 passing tests and this test failing with:
AssertionError: expected 1 to be close to 2 +/- 0.001
Snippet:
test('use respects preserveAspectRatio=none', function () {
const record = createSVG(`
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<symbol id="stretch" viewBox="0 0 100 100" preserveAspectRatio="none">
<rect x="0" y="0" width="100" height="100" />
</symbol>
</defs>
<use href="#stretch" width="200" height="100" />
</svg>
`);
const scope = firstChild(record);
const node = scope.children[0];
assert.closeTo(node.state.transform.a, 2, 0.001);
assert.closeTo(node.state.transform.d, 1, 0.001);
});
Most appropriate sub-area of p5.js?
p5.js version
2.3.2
Web browser and version
No response
Operating system
macOS 15.7.3
Steps to reproduce this
Steps:
<defs> and <use> elementssuite intest/unit/svg/svg_import.js.npm test -- test/unit/svg/svg_import.js.node.state.transform.ais1instead of the expected2.The test uses a 100×100
<symbol>withpreserveAspectRatio="none"inside a 200×100<use>viewport. In this case, the expected transform is non-uniform scaling: 2× horizontally and 1× vertically.I reproduced this on p5.js 2.3.2 (main at
7f9e0fda5). The SVG importer test suite reports 92 passing tests and this test failing with:AssertionError: expected 1 to be close to 2 +/- 0.001Snippet: