Skip to content
Browse files

Integration between text styles and (dynamic) values

  • Loading branch information...
1 parent 20fe739 commit 8b0fd5800f2c272ee2243e2be36bb707570e6251 @stathissideris committed
Showing with 9 additions and 7 deletions.
  1. +2 −4 src/dali/backend/java_2d.clj
  2. +1 −0 src/dali/style.clj
  3. +6 −3 src/dali/test.clj
View
6 src/dali/backend/java_2d.clj
@@ -300,12 +300,10 @@
(if (has-fill? shape)
(isolate-style this
(set-paint this (eval-dynamic-style
- shape
- (get-in shape [:style :fill])))
+ this shape (get-in shape [:style :fill])))
(if (has-transform? shape)
(with-transform this (eval-dynamic-style
- shape
- (:transform shape))
+ this shape (:transform shape))
(render-fn))
(render-fn)))
(render-fn)))) ;;TODO
View
1 src/dali/style.clj
@@ -2,6 +2,7 @@
(:use [dali.utils]
[dali.math]
[dali.core]
+ [dali.backend]
[clojure.walk]))
(derive ::color ::fill)
View
9 src/dali/test.clj
@@ -45,9 +45,12 @@
(doto backend
(render-text (text {:fill (color 150 0 150)
- :transform [:translate (dynamic (minus (center this)))
- :rotate 30
- :translate (dynamic (center this))]}
+ :transform [:translate (dynamic
+ (minus (center
+ (text-bounds backend this))))
+ :rotate 10
+ :translate (dynamic (center
+ (text-bounds backend this)))]}
[185 25] "Testing the dali library"))
(render (arrow
{:stroke {:width 2

0 comments on commit 8b0fd58

Please sign in to comment.
Something went wrong with that request. Please try again.