Reference enhancement for `shapeMode()` - it does not affect GROUP shapes

Offen
#625 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
50/100
Issue-Typ
Dokumentation
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Bereich
documentation

Rechercherichtung

Beginne mit der Referenzseite zu shapeMode() und vergleiche ihre aktuelle Formulierung mit dem im Beispiel gezeigten Verhalten von GROUP PShape. Bestätige, ob das Verhalten für alle GROUP-Formen gilt, und füge, falls bestätigt, eine knappe Klarstellung hinzu; dokumentiere andernfalls die Bedingungen, die die Fälle unterscheiden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Which area of the website does this enhancement relate to?

Reference

Describe the enhancement

I propose for the shapeMode() reference page to include the information that when a PShape object is a GROUP it will not be affected by the shapeMode() drawing mode and will always be drawn from the "internal" origin of the shape. I think this behavior should not change.

Tentative/suggested addition:

Shape mode will not affect the drawing of GROUP PShape objects.

Why is this enhancement important?

I believe other users might be surprised by this behavior, as I was, and seek clarification at the reference documentation, which could have a note about it.

Additional context
void setup(){
     size(200, 200);
    
    shapeMode(CENTER);

    PShape shp = createShape(GROUP);
    PShape square = createShape(RECT, 0, 0, 80, 80);
    shp.addChild(square);
    shape(shp, 100, 100);
    
    PShape other = createShape();
    other.beginShape();
    other.noFill();
    other.vertex(0, 0);
    other.vertex(80, 0);
    other.vertex(80, 80);
    other.vertex(0, 80);
    other.endShape(CLOSE);    
    shape(other, 100, 100);
}

Image

I wonder if someone could confirm this is true for all GROUP shapes? If it is not the behavior for all groups, how to differentiate and predict the behavior? If this behavior is found to be incorrect, a bug, could we have an ORIGIN mode to trigger exactly this behavior on GROUPS?

I found out about this behavior because py5 generates GROUP shapes when converting from external geometry sources. Ref: https://github.com/py5coding/py5generator/discussions/623

Vorherrschende Sprache
MDX
Sterne
90
Forks
122
Ø Merge
1 Std. 43 Min.
Gemergte PRs (30 T.)
3

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus processing/processing-website

Alle Issues in processing/processing-website

Ähnliche Issues

Weitere Issues zu Documentation

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.