SVG importer does not apply root viewBox scaling to stroke widths
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Bắt đầu từ điểm vào của trình nhập SVG và tái hiện vấn đề bằng ví dụ SVG tối thiểu trong báo cáo, so sánh độ dày nét của đường với chiều cao của hình chữ nhật. Theo dõi cách root width/height và việc thu phóng viewBox được áp dụng, sau đó xác minh rằng cả hai đối tượng đều được kết xuất với cùng độ dày 20 đơn vị khi hệ số thu phóng là 0.25.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When the document width/height is different from the viewBox, geometry is scaled accordingly but not stroke widths (even when the aspect ratio is the same for both). Here's a minimal working (or in this case, failing?) example:
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="120" viewBox="0 0 960 480">
<line x1="120" y1="140" x2="840" y2="140"
stroke="#d62828" stroke-width="80" stroke-linecap="butt"/>
<rect x="120" y="300" width="720" height="80" fill="#1565c0"/>
</svg>
These two objects should have the same visual thickness: one is a line with stroke width of 80, another is a rectangle with height 80, no stroke.
Opening this file directly in Safari shows the intended result (also reproduced with macOS Preview, Inkscape, Firefox and Chrome):
But importing this in Graphite gives this:
I reproduced this issue on:
- RC6 macOS desktop app
- Graphite web app
- https://dev.graphite.art with the following About this release info:
Release Series: Alpha 5
Branch: master
Commit: e725f550
2026-09-07 02:57 Eastern Time
The issue is that the viewport is 240 × 120 while the viewBox is 960 × 480, giving a scale factor of 0.25. Both the 80-unit stroke width and the 80-unit rectangle height should render as 20 units/pixels thick. A workaround for now is simply to use the same values for width/height as for the viewBox.
Possibly related: PR #3942, issue #2435.
- Ngôn ngữ chính
- Rust
- Star
- 27.3k
- Fork
- 1.3k
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 64
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 GraphiteEditor/Graphite
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GraphiteEditor/Graphite#4396 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
GraphiteEditor/Graphite#4311 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
GraphiteEditor/Graphite#4275 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
GraphiteEditor/Graphite#3939 · 2 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
GraphiteEditor/Graphite#4572 · 3 bình luận ·
Tất cả issue của GraphiteEditor/Graphite
Issue tương tự
-
Replayed reasoning items send "content": null, which the Responses API schema does not permit Đang mởbug CLI custom-model
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
Missing examples for `Allocator` Đang mởA-allocators A-docs C-enhancement T-libs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100