processing / processing/processing4

Drawing the same SVG with different stroke weights causes rendering bug with P2D renderer

オープン
#817 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

bug core
主要言語
Java
スター
494
フォーク
183
平均マージ
4時間 39分
マージ済み PR(30日)
3

説明

Created by: cadin

Description

When drawing an SVG shape (with style disabled) using the P2D renderer, the rendering will glitch if the shape is drawn more than once with a different stroke weight.

Expected Behavior

The shape should appear on the canvas at different stroke weights.

Current Behavior

The first instance of the shape appears as expected. Subsequent shapes (drawn after changing strokeWeight) are drawn with a glitched stroke.

Steps to Reproduce

  1. Set up sketch with P2D renderer.
  2. Load an SVG into a PShape and call disableStyle() on it.
  3. Draw the shape to the screen once, then change strokeWeight and draw again.

Example code (from this repo with SVG file included):

PShape aSVG;

void setup() {
  size(600, 300, P2D); // changing to default renderer works

  aSVG = loadShape("A.svg");
  aSVG.disableStyle();
}

void draw() {
  background(255);
  scale(3);

  strokeWeight(1);
  shape(aSVG); // removing this first shape works

  strokeWeight(3); // removing this stroke change works
  shape(aSVG, 100, 0);
}

Your Environment

  • Processing version: 4.3
  • Operating System and OS version: Mac OS 14.2.1 (Intel)

Workarounds

  • Using the default renderer works as expected
  • Drawing the shape only once (with any stroke weight) works as expected
  • Drawing the shape multiple times without changing stroke weight works as expected
  • Loading the same SVG into a separate PShape instance to render as the second graphic works as expected

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

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

はじめの一歩

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

調査の方向性

提供されたP2DスケッチとSVGの再現から始め、続いてP2Dレンダラーがdisabled-styleのPShape描画の繰り返しとstrokeWeight値の変更をどのように処理するかを追跡します。スケッチを再現し、レンダリングされた両方の図形が要求されたstrokeWeight値で、グリッチなく描画されることを確認して修正を検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
computer-graphics
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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