Skip to content

Commit 2da4e01

Browse files
committed
add ellipse area method
1 parent 70f342c commit 2da4e01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/renderer/element/impl/shape/ellipse.cljs

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
"A" rx ry 0 0 1 (+ cx rx) cy
5555
"z"])))
5656

57+
(defmethod hierarchy/area :ellipse
58+
[el]
59+
(let [{{:keys [rx ry]} :attrs} el
60+
[rx ry] (map length/unit->px [rx ry])]
61+
(* Math/PI rx ry)))
62+
5763
(defmethod hierarchy/edit :ellipse
5864
[el [x y] handle]
5965
(case handle

0 commit comments

Comments
 (0)