@skyf0xx/hedgehog 2.0.7 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -69,6 +69,18 @@ of the three:
|
|
|
69
69
|
structure actually calls for the motif to animate; a motif that's
|
|
70
70
|
static per section doesn't need a live p5 instance at all — render
|
|
71
71
|
once and let CSS/GSAP handle any transform-level movement instead.
|
|
72
|
+
- **If the sketch exposes any setter that triggers a redraw** (e.g.
|
|
73
|
+
`p.setGrooveDensity`, any `noLoop()` sketch re-invoked on demand
|
|
74
|
+
instead of rendered exactly once), the draw function must be
|
|
75
|
+
idempotent across repeated calls: wrap its body in `p.push()` /
|
|
76
|
+
`p.pop()`, or call `p.resetMatrix()` and reset any accumulated style
|
|
77
|
+
state at the top, before applying `p.translate()`/`p.rotate()`/
|
|
78
|
+
`p.scale()` or other stateful calls. `p.clear()` empties the pixel
|
|
79
|
+
buffer but does **not** reset the transform or style stack — a
|
|
80
|
+
`translate()` inside a function called N times shifts the origin N
|
|
81
|
+
times, not once, so geometry that looks correct on first paint can
|
|
82
|
+
walk off-canvas entirely by the second or third call. This is a
|
|
83
|
+
silent failure: no error, no console warning, just nothing drawn.
|
|
72
84
|
- **CSS** — build from `clip-path`'s named shape functions
|
|
73
85
|
(`polygon()`, `circle()`, `ellipse()`, `inset()` with rounded corners)
|
|
74
86
|
or `border-radius`'s percentage syntax, composed via layering and
|
|
@@ -87,6 +99,13 @@ A motif is not correct because it compiles. Before writing it into
|
|
|
87
99
|
- **Render it and look.** Use the Bash tool to run the dev server or a
|
|
88
100
|
standalone preview and view the actual output — don't judge geometry
|
|
89
101
|
or a Canvas draw call from the source alone.
|
|
102
|
+
- **If the sketch exposes setters, call every one of them at least once,
|
|
103
|
+
in sequence, before judging it correct** — not just the initial
|
|
104
|
+
render. A bug in redraw idempotency (see the p5.js transform/style
|
|
105
|
+
reset rule above) is invisible on first paint and only shows up after
|
|
106
|
+
the second or later invocation, which is exactly how the setter will
|
|
107
|
+
actually be used once mounted (density/scale changes fire after
|
|
108
|
+
`setup()`, not instead of it).
|
|
90
109
|
- **State the construction's parameters and what each one is for** — a
|
|
91
110
|
p5.js formula's inputs, a `clip-path` shape's control values, a Canvas
|
|
92
111
|
draw's measured inputs — before accepting it. If you can't say why a
|