processing / processing/processing4
Drawing the same SVG with different stroke weights causes rendering bug with P2D renderer
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 494
- Forks
- 183
- Ø Merge
- 4 Std. 39 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
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
- Set up sketch with P2D renderer.
- Load an SVG into a PShape and call
disableStyle()on it. - Draw the shape to the screen once, then change
strokeWeightand 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der bereitgestellten P2D-Skizze und der SVG-Reproduktion und verfolge dann, wie der P2D-Renderer wiederholte PShape-Zeichnungen mit disabled-style und sich ändernden strokeWeight-Werten verarbeitet. Bestätige die Korrektur, indem du die Skizze reproduzierst und überprüfst, dass beide gerenderten Formen die angeforderten strokeWeight-Werte ohne Darstellungsfehler haben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- computer-graphics
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100