Canvas Draw: Difference between revisions

Line 19: Line 19:
Ideally, the new 2D drawing helpers would be agnostic to the concrete use-case, so that they can be used for arbitrary purposes. This can be accomplished by following a few simple design principles:
Ideally, the new 2D drawing helpers would be agnostic to the concrete use-case, so that they can be used for arbitrary purposes. This can be accomplished by following a few simple design principles:


* all drawing callbacks should accept a mandatory group/element node
* all drawing callbacks should accept a mandatory group/element node to operate on
* all drawing callbacks should accept/support an optional options hash
* all drawing callbacks should accept/support an optional options hash
* all drawing callback should return the corresponding Canvas element  
* all drawing callback should return the corresponding Canvas element