SVG importer does not apply root viewBox scaling to stroke widths
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
从 SVG 导入器的入口点开始,使用报告中的最小 SVG 示例重现问题,并比较线条描边与矩形高度。跟踪 root width/height 和 viewBox 缩放的应用方式,然后验证当缩放因子为 0.25 时,两个对象都以相同的 20 单位厚度进行渲染。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Rust
- 星标
- 27.3k
- 派生
- 1.3k
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 64
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GraphiteEditor/Graphite 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
GraphiteEditor/Graphite#4396 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
GraphiteEditor/Graphite#4311 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
GraphiteEditor/Graphite#4275 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
GraphiteEditor/Graphite#3939 · 2 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 52/100
GraphiteEditor/Graphite#4572 · 3 条评论 ·
查看 GraphiteEditor/Graphite 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yantrikos/yantrik-os#255 ·
-
bug CLI custom-model
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
raphamorim/rio#1956 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
rust-bitcoin/rust-bitcoin#6930 · 1 条评论 ·