2010/11/15 Samuel Ytterbrink <[email protected]>: > 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
