Skip to content

Commit

Permalink
add ellipse area method
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc committed Dec 4, 2024
1 parent 70f342c commit 2da4e01
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/renderer/element/impl/shape/ellipse.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
"A" rx ry 0 0 1 (+ cx rx) cy
"z"])))

(defmethod hierarchy/area :ellipse
[el]
(let [{{:keys [rx ry]} :attrs} el
[rx ry] (map length/unit->px [rx ry])]
(* Math/PI rx ry)))

(defmethod hierarchy/edit :ellipse
[el [x y] handle]
(case handle
Expand Down

0 comments on commit 2da4e01

Please sign in to comment.