Skip to content

Commit

Permalink
Add scaling-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinmera committed Nov 30, 2019
1 parent 0d8469c commit 0ddee8d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions alloy/ui.lisp
Expand Up @@ -9,6 +9,9 @@
(defclass ui (renderer alloy:ui trial:entity)
())

(defclass scaling-ui (ui)
())

(defmethod trial:paint ((ui ui) target)
(alloy:render ui ui))

Expand All @@ -18,6 +21,10 @@
(defmethod trial:handle ((ev trial:event) (ui ui)))

(defmethod trial:handle ((ev trial:resize) (ui ui))
(setf (alloy:visible-bounds ui) (alloy:px-extent 0 0 (trial:width ev) (trial:height ev)))
(alloy:suggest-bounds (alloy:visible-bounds ui) (alloy:layout-tree ui)))

(defmethod trial:handle ((ev trial:resize) (ui scaling-ui))
(alloy:suggest-bounds (alloy:px-extent 0 0 (trial:width ev) (trial:height ev)) ui))

(defmacro define-event-translator (trial-type alloy-type &body args)
Expand Down

0 comments on commit 0ddee8d

Please sign in to comment.