[p5.js 2.0+ Bug Report]: SVG importer does not respect preserveAspectRatio="none" for <symbol>/<use>
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 83/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Bắt đầu với bộ kiểm thử các phần tử <defs> và <use> trong test/unit/svg/svg_import.js rồi chạy npm test -- test/unit/svg/svg_import.js để xác nhận lỗi. Theo dõi cách trình nhập SVG xử lý preserveAspectRatio đối với một symbol được tham chiếu bằng <use>. Hoàn thành khi kiểm thử hồi quy vượt qua với phép biến đổi ngang bằng 2 và phép biến đổi dọc bằng 1.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- WebGPU
- p5.strands
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
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> elementssuite intest/unit/svg/svg_import.js. - Run
npm test -- test/unit/svg/svg_import.js. - Observe that the test fails because
node.state.transform.ais1instead of the expected2.
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);
});
- Ngôn ngữ chính
- JavaScript
- Star
- 24.1k
- Fork
- 3.9k
- Merge trung bình
- 2 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 37
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của processing/p5.js
-
[p5.js 2.0+ Bug Report]: touches[0].x lags one pointer event behind while draggingCó thể đã có người làm @titanstride đã nhận hôm nay. Đang mởArea:Events p5.js 2.0+
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
processing/p5.js#9305 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
loadModel() options break without fileType and ignore flipU/flipVCó thể đã có người làm @saniyaa-17 đã nhận hôm nay. Đang mởArea:WebGL p5.js 2.0+
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
processing/p5.js#9302 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[p5.js 2.0+ Bug Report]: key docs needs updatingCó thể đã có người làm @MannXo đã nhận 1 ngày trước. Đang mởHelp Wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
processing/p5.js#9296 · 5 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
False positive FES warning for loadModel(path, callback)Có thể đã có người làm @xsupremeyx đã nhận 2 ngày trước. Đang mởp5.js 2.0+
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
processing/p5.js#9295 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Add unit tests for noiseDetail()Có thể đã có người làm @harshiltewari2004 đã nhận 4 ngày trước. Đang mởArea:Math Enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
processing/p5.js#9253 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của processing/p5.js
Issue tương tự
-
effort:low model:light plan planner:fable-5-1 test-quality tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: agent area: theme help wanted lane: free-agent roadmap size: S status: needs-brief type: layout type: task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 60/100
arminazimi/slipway#64 ·
-
release:v5.34
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Jason-Vaughan/TangleClaw#2469 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hacktoberfest help wanted skip-changelog
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
wassim-azi/agy-powerline#74 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
MadeBaruna/paimon-moe#696 ·