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 wrap: on
line diff
--- a/src/indyvon/component.clj Sun Jun 13 04:57:14 2010 +0400 +++ b/src/indyvon/component.clj Mon Jun 14 04:38:00 2010 +0400 @@ -27,7 +27,7 @@ context (assoc (default-context) :dispatcher event-dispatcher :update-fn (make-update-fn this))] - (render-layer! context layer g 0 0 width height false)) + (draw! context layer g 0 0 width height false)) (commit event-dispatcher)) (getPreferredSize [] ;; TODO: supply context @@ -52,15 +52,15 @@ (register-context context) (.setColor g Color/BLUE) (.fillRect g 0 0 (:width context) (:height context)) - (render-layer! context layer1 g 10 5) - (render-layer! context layer1 g 50 5)) + (draw! context layer1 g 10 5) + (draw! context layer1 g 50 5)) (size [this context] [70 65]))) (def layer (reify-layer (render! [this context g] ;;(register-context context) (.drawLine g 0 0 (:width context) (:height context)) - (render-layer! context layer2 g 15 20)) + (draw! context layer2 g 15 20)) (size [this context] [100 100]))) (doto frame (.addWindowListener
--- a/src/indyvon/core.clj Sun Jun 13 04:57:14 2010 +0400 +++ b/src/indyvon/core.clj Mon Jun 14 04:38:00 2010 +0400 @@ -35,19 +35,19 @@ (doto (.create g) (.translate x y)))) -(defn render-layer! +(defn draw! "Render layer in a new graphics context." ([context layer graphics] - (render-layer! context layer graphics + (draw! context layer graphics 0 0 (:width context) (:height context))) ([context layer graphics x y] - (render-layer! context layer graphics x y true)) + (draw! context layer graphics x y true)) ([context layer graphics x y clip] (let [s (size layer context)] - (render-layer! context layer graphics + (draw! context layer graphics x y (s 0) (s 1) clip))) ([context layer graphics x y w h] - (render-layer! context layer graphics + (draw! context layer graphics x y w h true)) ([context layer graphics x y w h clip] (let [graphics (make-graphics graphics x y w h clip)]