Canvas Draw: Difference between revisions

Line 9: Line 9:


It seems, it would be good to start such thing and my first elements would be a compass rose and a linear tape (e.g. for speed and altitude), stylable of course. So the library should also contain a structure to organize styles.
It seems, it would be good to start such thing and my first elements would be a compass rose and a linear tape (e.g. for speed and altitude), stylable of course. So the library should also contain a structure to organize styles.
== Design ==
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/support an optional options hash
* all drawing callback should return the corresponding Canvas element
This would be in line with the existing Canvas/MapStructure APIs, and it would also make it possible to easily use delegates to customize internal behavior


== Related ==
== Related ==