0 | module Rhone.Canvas.Scene
2 | import Control.Monad.Either.Extra
4 | import Rhone.Canvas.Shape
5 | import Rhone.Canvas.Style
6 | import Rhone.Canvas.Transformation
7 | import Rhone.JS.Reactimate
13 | data Scene : Type where
14 | S1 : (fs : List Style) -> (tr : Transformation) -> (shape : Shape) -> Scene
15 | SM : (fs : List Style) -> (tr : Transformation) -> List Scene -> Scene
23 | applyAll : CanvasRenderingContext2D -> List Scene -> JSIO ()
24 | applyAll ctxt = assert_total $
traverseList_ (apply ctxt)
27 | apply : CanvasRenderingContext2D -> Scene -> JSIO ()
28 | apply ctxt (S1 fs tr shape) = do
30 | traverseList_ (apply ctxt) fs
35 | apply ctxt (SM fs tr xs) = do
37 | traverseList_ (apply ctxt) fs