From b81607c561d6964313bb1f87c0890fc95ccceec7 Mon Sep 17 00:00:00 2001 From: Charles Comstock Date: Sun, 2 Feb 2025 16:14:20 -0600 Subject: [PATCH] use min-axis for bounded-shapes/square --- src/shimmers/math/geometry/bounded_shapes.cljc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shimmers/math/geometry/bounded_shapes.cljc b/src/shimmers/math/geometry/bounded_shapes.cljc index df40966a..974142a1 100644 --- a/src/shimmers/math/geometry/bounded_shapes.cljc +++ b/src/shimmers/math/geometry/bounded_shapes.cljc @@ -73,8 +73,8 @@ `s%` is the percent size of min(width,height) of the bounding rectangle." ([bounds] (square bounds (dr/random))) - ([{pos :p [width height] :size} s%] - (let [size (* s% (min height width))] + ([{pos :p [width height] :size :as bounds} s%] + (let [size (* s% (geometry/min-axis bounds))] (rect/rect (tm/+ pos (gv/vec2 (dr/random 0 (- width size)) (dr/random 0 (- height size)))) size size))))