HTML and CSS Reference
In-Depth Information
straightlinefromthecurrentpathpositiontothisnewposition.Thenitdrawsanarcfromthat
point to the
y1
,
y2
point, using the given radius.
The
context.arcTo
method will work only if the current path has at least one subpath. So,
let's start with a line from position 0,0 to position 100,200. Then we will build our small arc.
It will look a little like a bent wire coat hanger (for lack of a better description), as shown in
context
.
moveTo
(
0
,
0
);
context
.
lineTo
(
100
,
200
);
context
.
arcTo
(
350
,
350
,
100
,
100
,
20
);
Figure 2-7. An arcTo() example