1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
.. default-domain:: js
.. highlight:: javascript
PathWalker
==========
Constructors
------------
.. class:: PathWalker
|interface_type|
An object implementing this interface of optional callback functions
can be used to get calls whenever `Path.prototype.walk()` iterates over a
basic drawing operation corresponding to that of the function name.
.. function:: closePath()
Called when `Path.prototype.walk()` encounters a close subpath operation.
.. function:: curveTo(x1, y1, x2, y2, x3, y3)
Called when `Path.prototype.walk()` encounters an operation drawing a Bézier
curve from the current point to (x3, y3) using (x1, y1) and (x2, y2)
as control points.
.. image:: ../../../images/curveTo.svg
:param number x1: X1 coordinate.
:param number y1: Y1 coordinate.
:param number x2: X2 coordinate.
:param number y2: Y2 coordinate.
:param number x3: X3 coordinate.
:param number y3: Y3 coordinate.
.. function:: lineTo(x, y)
Called when `Path.prototype.walk()` encounters an operation drawing a straight
line from the current point to the given point.
.. image:: ../../../images/lineTo.svg
:param number x: X coordinate.
:param number y: Y coordinate.
.. function:: moveTo(x, y)
Called when `Path.prototype.walk()` encounters an operation moving the pen to
the given point, beginning a new subpath and sets the current point.
:param number x: X coordinate.
:param number y: Y coordinate.
|