[whatwg] fxCanvas 0.2 and some remarks about canvas spec

Evgeny Burzak buzzilo at gmail.com
Mon Nov 15 21:38:26 PST 2010


2010/11/15 Samuel Ytterbrink <samuel at ytterbrink.nu>:
> hmm... Can you explain the path-object more in detail. It sounds
> interesting... but why shouldn't i just create a function that takes a
> context and do the same path commands on it instead of having a context
> taking a path object?
>

In case of >1000 path nodes , path object may save good portion of
time due to caching mechanism.
Inside  IExplorer, path is serialized  so that , I can drawing even
complicated curves without a hung.

And technical details:
CanvasPath instance has all canvas path drawings methods , plus:

append(<path object>)
clone()
push(<segment>)
pop()

Path segment is just an array, for ex. ["moveTo", [0,0]].

In current version nodes are saved in _stack property, but i think
CanvasPath should be special array, so that i can get n-th segment as
path[n].

Related methods in canvas context:

beginPath() - is created new path object inside context
createPath() - creates and returns path obj instance
appendPath() - appends to the current path
clonePath() - clones and returns path obj

Evgeny



More information about the whatwg mailing list