Skip to content

Commit

Permalink
support nil in graphics ops; alpha release
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Feb 27, 2020
1 parent 1e7fc1a commit 5849dd3
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 330 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Previews http://repo.quamolit.org/phlox/ .
[![Clojars Project](https://img.shields.io/clojars/v/quamolit/phlox.svg)](https://clojars.org/quamolit/phlox)

```edn
[quamolit/phlox "0.1.4"]
[quamolit/phlox "0.1.5-a3"]
```

`render!` to add canvas to `<body/>`:
Expand Down
125 changes: 77 additions & 48 deletions calcit.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -668,18 +668,26 @@
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581527114427)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581527114427) (:text |vector+) (:id |URBIOBcY9E)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581527114427)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582825471879)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581527114427) (:text |tuple+) (:id |F8c3a79P3O)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581527114427)
|T $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581527114427)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581527114427) (:text |[]) (:id |oYCLhHWgN5)
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581527114427) (:text |tuple+) (:id |F8c3a79P3O)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581527114427)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581527114427) (:text |keyword+) (:id |UoAlipJrvG)
:id |jRDcsbr9MZ
:id |hHkK-7OsHT
:id |jQ7HpvQUgg
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581527114427) (:text |[]) (:id |oYCLhHWgN5)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581527114427)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581527114427) (:text |keyword+) (:id |UoAlipJrvG)
:id |jRDcsbr9MZ
|r $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582825451732)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825452036) (:text |any+) (:id |XsoDR8ViD)
:id |_jBDrkkvJ
:id |hHkK-7OsHT
:id |jQ7HpvQUgg
|D $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825474569) (:text |optional+) (:id |_HVkE4bb)
:id |Zch15ERA
|r $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582821732025)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582821732390) (:text |{}) (:id |cpZVTTigw)
Expand Down Expand Up @@ -1693,8 +1701,9 @@
|yx $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1574181860944) (:id |pF3NSJfB_KU)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1574442539002) (:text |js/console.warn) (:id |z-hQyAIakTv)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1574181860944) (:text "|\"not supported:") (:id |lXJVqCjyfhT)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825810647) (:text "|\"not supported op:") (:id |lXJVqCjyfhT)
|r $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1574181860944) (:text |op) (:id |SK1nrf5XNMP)
|v $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825808794) (:text |data) (:id |rxTKTEoh)
|yvj $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581436959742)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581436974437) (:text |:quadratic-to) (:id |wZ1zJgn3oleaf)
Expand Down Expand Up @@ -1862,6 +1871,14 @@
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581436931155) (:text |target) (:id |hee3d7Cau)
:id |j3AA0Nlqf
:id |u-Ii8qEFP
|ywj $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582825581420)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825582951) (:text |nil) (:id |1pdLPgaoleaf)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582825814592)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825815259) (:text |do) (:id |4Y9kvprjZ)
:id |2A6sB5-Oj
:id |1pdLPgao
|yv $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1574181860944) (:id |HQ8zD2zUmls)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1574181860944) (:text |:arc-to) (:id |0eHhII6_C0E)
Expand Down Expand Up @@ -3782,6 +3799,45 @@
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581437589013)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582822255204) (:text |[]) (:id |DVFrtF5Yw)
|yr $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |g) (:id |fIu6Q2TrN)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:bezier-to) (:id |HJO4SQKJh)
|r $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |{}) (:id |OK44velX3)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:p1) (:id |XK03Szs6y)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |[]) (:id |bgCNHsETn)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |400) (:id |AU1V3DQeD)
|r $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |500) (:id |PCM4UVzgl)
:id |qEwXAkcOs
:id |4rZ1-mKbr
|r $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:p2) (:id |8c2OR5ovx)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |[]) (:id |5in6UAeluC)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |300) (:id |gIaX6wh6iG)
|r $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |200) (:id |gsEt4hUX10)
:id |xVg_cMerVV
:id |aNJtUiCxd
|v $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:to-p) (:id |QCU_GalCw_)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |[]) (:id |W5SVOM1bMU)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |600) (:id |ycqXu74WyE)
|r $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |300) (:id |uz1d_3irA4)
:id |gjkAfqYRqc
:id |EzXtL6JriF
:id |gUSFxHJgz
:id |3EuzvAAXk
|yT $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581438206021)
:data $ {}
|T $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1581438200612)
Expand Down Expand Up @@ -3936,45 +3992,18 @@
|D $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581850025782) (:text |g) (:id |OLtZ_uDmS)
|L $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1581438400576) (:text |:quadratic-to) (:id |RroVyDNL)
:id |nkeGWxKc
|yr $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |g) (:id |fIu6Q2TrN)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:bezier-to) (:id |HJO4SQKJh)
|r $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |{}) (:id |OK44velX3)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:p1) (:id |XK03Szs6y)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |[]) (:id |bgCNHsETn)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |400) (:id |AU1V3DQeD)
|r $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |500) (:id |PCM4UVzgl)
:id |qEwXAkcOs
:id |4rZ1-mKbr
|r $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:p2) (:id |8c2OR5ovx)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |[]) (:id |5in6UAeluC)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |300) (:id |gIaX6wh6iG)
|r $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |200) (:id |gsEt4hUX10)
:id |xVg_cMerVV
:id |aNJtUiCxd
|v $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |:to-p) (:id |QCU_GalCw_)
|j $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582823442959)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |[]) (:id |W5SVOM1bMU)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |600) (:id |ycqXu74WyE)
|r $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582823442959) (:text |300) (:id |uz1d_3irA4)
:id |gjkAfqYRqc
:id |EzXtL6JriF
:id |gUSFxHJgz
:id |3EuzvAAXk
|yv $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582825493019)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825493654) (:text |g) (:id |qkx5NWNlleaf)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825497040) (:text |:line-to) (:id |0qha4SFus)
|r $ {} (:type :expr) (:by |rJG4IHzWf) (:at 1582825499149)
:data $ {}
|T $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825498167) (:text |400) (:id |U4fqQeYR)
|D $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825499741) (:text |[]) (:id |ZBJFwqxjy)
|j $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825500986) (:text |400) (:id |6JVBCh_W)
:id |0guGBjoV
|D $ {} (:type :leaf) (:by |rJG4IHzWf) (:at 1582825645118) (:text |;) (:id |qle6bj5rG)
:id |qkx5NWNl
:id |Thjux3tSj
:id |8uPw_9XxQ
:id |LFpV-BX7Q
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"license": "MIT",
"devDependencies": {
"http-server": "^0.12.1",
"shadow-cljs": "^2.8.83"
"shadow-cljs": "^2.8.88"
},
"dependencies": {
"pixi.js": "^5.2.1",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>quamolit</groupId>
<artifactId>phlox</artifactId>
<version>0.1.5-a2</version>
<version>0.1.5-a3</version>
<name>phlox</name>

<url>https://github.com/Quamolit/phlox</url>
Expand Down
3 changes: 2 additions & 1 deletion src/phlox/app/container.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
(g :arc-to {:p1 [200 200], :p2 [240 180], :radius 90})
(g :arc {:center [260 120], :radius 40, :angle [70 60], :anticlockwise? false})
(g :quadratic-to {:p1 [400 100], :to-p [500 400]})
(g :bezier-to {:p1 [400 500], :p2 [300 200], :to-p [600 300]})]}))
(g :bezier-to {:p1 [400 500], :p2 [300 200], :to-p [600 300]})
(comment g :line-to [400 400])]}))

(defcomp
comp-drafts
Expand Down
2 changes: 1 addition & 1 deletion src/phlox/check.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
:alpha (optional+ (number+)),
:rotation (optional+ (number+)),
:angle (optional+ (number+)),
:ops (vector+ (tuple+ [(keyword+)]) {:allow-seq? true})}
:ops (vector+ (optional+ (tuple+ [(keyword+) (any+)])) {:allow-seq? true})}
{:check-keys? true}))

(def lilac-rect
Expand Down
3 changes: 2 additions & 1 deletion src/phlox/render/draw.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
(.quadraticCurveTo target (first p1) (peek p1) (first to-p) (peek to-p)))
:begin-hole (.beginHole target)
:end-hole (.endHole target)
(js/console.warn "not supported:" op))))
nil (do)
(js/console.warn "not supported op:" op data))))

(defn draw-circle [target radius]
(if (number? radius)
Expand Down
Loading

0 comments on commit 5849dd3

Please sign in to comment.