SVG importer does not apply root viewBox scaling to stroke widths
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
SVG importer のエントリーポイントから始め、レポートにある最小限の 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分
- マージ済み PR(30日)
- 64
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
GraphiteEditor/Graphite#4572 · コメント 3 件 ·
GraphiteEditor/Graphite の issue をすべて見る
似ている issue
-
bug CLI custom-model
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
rust-bitcoin/rust-bitcoin#6930 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
fulcrumgenomics/ferro-hgvs#2251 ·
-
A-allocators A-docs C-enhancement T-libs
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100