Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

SVG importer does not apply root viewBox scaling to stroke widths

オープン
#4,515 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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):
Image

But importing this in Graphite gives this:
Image

I reproduced this issue on:

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GraphiteEditor/Graphite のほかの issue

GraphiteEditor/Graphite の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。