Mercurial > hg > indyvon
changeset 11:ea6fc44f19c8
Rename render-layer! to draw!
author | Mikhail Kryshen <mikhail@kryshen.net> |
---|---|
date | Mon, 14 Jun 2010 04:38:00 +0400 |
parents | 9af27ccccfac |
children | cd8a378414d1 |
files | src/indyvon/component.clj src/indyvon/core.clj |
diffstat | 2 files changed, 9 insertions(+), 9 deletions(-) [+] |
line diff
1.1 --- a/src/indyvon/component.clj Sun Jun 13 04:57:14 2010 +0400 1.2 +++ b/src/indyvon/component.clj Mon Jun 14 04:38:00 2010 +0400 1.3 @@ -27,7 +27,7 @@ 1.4 context (assoc (default-context) 1.5 :dispatcher event-dispatcher 1.6 :update-fn (make-update-fn this))] 1.7 - (render-layer! context layer g 0 0 width height false)) 1.8 + (draw! context layer g 0 0 width height false)) 1.9 (commit event-dispatcher)) 1.10 (getPreferredSize [] 1.11 ;; TODO: supply context 1.12 @@ -52,15 +52,15 @@ 1.13 (register-context context) 1.14 (.setColor g Color/BLUE) 1.15 (.fillRect g 0 0 (:width context) (:height context)) 1.16 - (render-layer! context layer1 g 10 5) 1.17 - (render-layer! context layer1 g 50 5)) 1.18 + (draw! context layer1 g 10 5) 1.19 + (draw! context layer1 g 50 5)) 1.20 (size [this context] [70 65]))) 1.21 (def layer 1.22 (reify-layer 1.23 (render! [this context g] 1.24 ;;(register-context context) 1.25 (.drawLine g 0 0 (:width context) (:height context)) 1.26 - (render-layer! context layer2 g 15 20)) 1.27 + (draw! context layer2 g 15 20)) 1.28 (size [this context] [100 100]))) 1.29 (doto frame 1.30 (.addWindowListener
2.1 --- a/src/indyvon/core.clj Sun Jun 13 04:57:14 2010 +0400 2.2 +++ b/src/indyvon/core.clj Mon Jun 14 04:38:00 2010 +0400 2.3 @@ -35,19 +35,19 @@ 2.4 (doto (.create g) 2.5 (.translate x y)))) 2.6 2.7 -(defn render-layer! 2.8 +(defn draw! 2.9 "Render layer in a new graphics context." 2.10 ([context layer graphics] 2.11 - (render-layer! context layer graphics 2.12 + (draw! context layer graphics 2.13 0 0 (:width context) (:height context))) 2.14 ([context layer graphics x y] 2.15 - (render-layer! context layer graphics x y true)) 2.16 + (draw! context layer graphics x y true)) 2.17 ([context layer graphics x y clip] 2.18 (let [s (size layer context)] 2.19 - (render-layer! context layer graphics 2.20 + (draw! context layer graphics 2.21 x y (s 0) (s 1) clip))) 2.22 ([context layer graphics x y w h] 2.23 - (render-layer! context layer graphics 2.24 + (draw! context layer graphics 2.25 x y w h true)) 2.26 ([context layer graphics x y w h clip] 2.27 (let [graphics (make-graphics graphics x y w h clip)]