Skip to content

Commit

Permalink
use min-axis for bounded-shapes/square
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Feb 2, 2025
1 parent b4a2434 commit b81607c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shimmers/math/geometry/bounded_shapes.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down

0 comments on commit b81607c

Please sign in to comment.