Skip to content

Commit

Permalink
Minor fix for suggest-size on ellipse
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Jun 13, 2024
1 parent 864f29d commit c24dac6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions renderers/simple/defaults.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@
(when end-angle-p
(setf (end-angle ellipse) end-angle)))

(defmethod alloy:suggest-size ((size T) (component ellipse))
(let ((bounds (bounds component)))
(typecase bounds
(alloy:size (alloy:px-size (alloy:pxw bounds) (alloy:pxh bounds)))
;; Require enough space for the combined margins.
(alloy:margins (alloy:px-size
(max (alloy:pxw size) (+ (alloy:pxl bounds) (alloy:pxr bounds)))
(max (alloy:pxh size) (+ (alloy:pxu bounds) (alloy:pxb bounds)))))
(T size))))

(defmethod (setf start-angle) ((value real) (ellipse ellipse))
(setf (slot-value ellipse 'start-angle) (float value 0f0)))

Expand Down

0 comments on commit c24dac6

Please sign in to comment.