dyoo / whalesong

Whalesong: Racket to JavaScript compiler
http://hashcollision.org/whalesong
250 stars 30 forks source link

dom canvases do not draw in web-world #52

Closed dyoo closed 13 years ago

dyoo commented 13 years ago

This is related to: http://stackoverflow.com/questions/3318565/any-way-to-clone-html5-canvas-element-with-its-content

When we do the initial cloning of a dom in web-world, we inadvertently throw away the content already drawn on the canvas.

dyoo commented 13 years ago

Addressed in: 89d485ed2935c2d620516dd4938c9bc9d3091f78. The program:

#lang planet dyoo/whalesong/cs019
(big-bang 5
          (to-draw (lambda (w dom)
                     (list 
                      "circle"
                      (circle w 'solid 'green)
                      "end")))
          (on-tick (lambda (w v) (add1 w))
                   1))

finally shows something on screen.