diff --git a/src/Index.tsx b/src/Index.tsx index 3cb0d54..8d287e8 100644 --- a/src/Index.tsx +++ b/src/Index.tsx @@ -234,6 +234,15 @@ function Index() { Octave setState({ ...state, octave })} /> +
+ Size + setState({ ...state, size: v })} + /> +
{ const presetPoints = (() => { switch (state.preset) { case "triangle": - return generateTrianglePoints(0, 0, SHAPE_RADIUS, NUM_POINTS); + return generateTrianglePoints(0, 0, radius, NUM_POINTS); case "square": - return generateSquarePoints(0, 0, SHAPE_RADIUS, NUM_POINTS); + return generateSquarePoints(0, 0, radius, NUM_POINTS); case "circle": - return generateCirclePoints(0, 0, SHAPE_RADIUS, NUM_POINTS); + return generateCirclePoints(0, 0, radius, NUM_POINTS); } })(); - const circlePoints = generateCirclePoints(0, 0, SHAPE_RADIUS, NUM_POINTS); + const circlePoints = generateCirclePoints(0, 0, radius, NUM_POINTS); const t = state.roundness / 100; return morphPoints(presetPoints, circlePoints, t); - }, [state.preset, state.roundness]); + }, [state.preset, state.roundness, radius]); const flatPoints = useMemo(() => { const wobbleAmount = state.wobble * 0.3; // scale wobble to reasonable range