diff --git a/errata.md b/errata.md index 062ceec..df3ec8e 100644 --- a/errata.md +++ b/errata.md @@ -55,6 +55,17 @@ Typo in the last sentence, it should read: *You should have no trouble creating some beautiful pictures or animations with trigonometry.* +### p. 82, p. 84 + +In examples `04-multi-curve-1.html` and +`05-multi-curve-2.html`, the code to move to the first point +should read: (Submitted by Gerald Cullen) + +~~~ +context.beginPath(); +context.moveTo(points[0].x, points[0].y); +~~~ + ### p. 111 A production error caused an errant graphic to obscure diff --git a/examples/ch04/04-multi-curve-1.html b/examples/ch04/04-multi-curve-1.html index a586b72..d12b7c9 100644 --- a/examples/ch04/04-multi-curve-1.html +++ b/examples/ch04/04-multi-curve-1.html @@ -29,7 +29,7 @@ //move to the first point context.beginPath(); - context.moveTo(points[0].x, points[1].y); + context.moveTo(points[0].x, points[0].y); //and loop through each successive pair for (i = 1; i < numPoints; i += 2) { context.quadraticCurveTo(points[i].x, points[i].y, diff --git a/examples/ch04/05-multi-curve-2.html b/examples/ch04/05-multi-curve-2.html index bbe9896..99d712b 100644 --- a/examples/ch04/05-multi-curve-2.html +++ b/examples/ch04/05-multi-curve-2.html @@ -29,7 +29,7 @@ //move to the first point context.beginPath(); - context.moveTo(points[0].x, points[1].y); + context.moveTo(points[0].x, points[0].y); //curve through the rest, stopping at each midpoint for (i = 1; i < numPoints - 2; i++) { ctrlPoint.x = (points[i].x + points[i+1].x) / 2;