The WHATWG Blog

Please leave your sense of logic at the door, thanks!

WHATWG Weekly: Path objects for canvas and creating paths through SVG syntax

by Anne van Kesteren in Weekly Review

Jonas Sicking proposed an API for decoding ArrayBuffer objects as strings, and encoding strings as ArrayBuffer objects. The thread also touched on a proposal mentioned here earlier, StringEncoding. This is the mid-March WHATWG Weekly.

Revision 7023 added the Path object to HTML for use with the canvas element, and the next revision made it possible to actually use it:

var path = new Path()
path.rect(1,1,10,10)
context.stroke(path)

A new method addPathData() (introduced in revision 7026) can be used to construct canvas paths using SVG path data. Revision 7025 meanwhile added ellipse support to canvas.

Tune in next week for more additions to canvas.

2 Responses to “WHATWG Weekly: Path objects for canvas and creating paths through SVG syntax”

  1. Wow! I am really excited by these additions and the hitRegion stuff. It looks like much / most of this could be implemented on top of the existing API as a shim.

  2. It seems to me the addPathData() method has been dropped. For what reason?