@@ -124,11 +124,11 @@ through the `getContext` method on the `<canvas>` element.
124124</script>
125125----
126126
127- ifdef::tex_target []
127+ ifdef::book_target []
128128
129129image::img/canvas_fill.png[alt="A canvas with a rectangle",width="3cm"]
130130
131- endif::tex_target []
131+ endif::book_target []
132132
133133After creating the context object, the example draws a red
134134((rectangle)) 100 ((pixel))s wide and 50 pixels high, with its top
@@ -181,11 +181,11 @@ positive number.
181181</script>
182182----
183183
184- ifdef::tex_target []
184+ ifdef::book_target []
185185
186186image::img/canvas_stroke.png[alt="Two stroked squares",width="5cm"]
187187
188- endif::tex_target []
188+ endif::book_target []
189189
190190(((default value)))(((canvas,size)))When no `width` or `height`
191191attributes are specified, as in the previous example, a canvas element
@@ -212,11 +212,11 @@ describing such a path is rather peculiar. It is done entirely through
212212</script>
213213----
214214
215- ifdef::tex_target []
215+ ifdef::book_target []
216216
217217image::img/canvas_path.png[alt="Stroking a number of lines",width="2.1cm"]
218218
219- endif::tex_target []
219+ endif::book_target []
220220
221221(((canvas)))(((stroke method)))(((lineTo method)))(((moveTo
222222method)))(((shape)))The example creates a path with a number of
@@ -245,11 +245,11 @@ start, and the shape enclosed by the resulting line is filled.
245245</script>
246246----
247247
248- ifdef::tex_target []
248+ ifdef::book_target []
249249
250250image::img/canvas_triangle.png[alt="Filling a path",width="2.2cm"]
251251
252- endif::tex_target []
252+ endif::book_target []
253253
254254This draws a filled triangle. Note that only two of the triangle's
255255sides are explicitly drawn. The third, from the bottom right corner
@@ -291,11 +291,11 @@ picture illustrates this:
291291</script>
292292----
293293
294- ifdef::tex_target []
294+ ifdef::book_target []
295295
296296image::img/canvas_quadraticcurve.png[alt="A quadratic curve",width="2.3cm"]
297297
298- endif::tex_target []
298+ endif::book_target []
299299
300300(((stroke method)))We draw a ((quadratic curve)) from the left to the
301301right, with (60,10) as control point, and then draw two ((line))
@@ -326,11 +326,11 @@ illustrates the behavior of such a curve:
326326</script>
327327----
328328
329- ifdef::tex_target []
329+ ifdef::book_target []
330330
331331image::img/canvas_beziercurve.png[alt="A bezier curve",width="2.2cm"]
332332
333- endif::tex_target []
333+ endif::book_target []
334334
335335The two control points specify the direction at both ends of the
336336curve. The further they are away from their corresponding point, the
@@ -370,11 +370,11 @@ start of the rounded part.
370370</script>
371371----
372372
373- ifdef::tex_target []
373+ ifdef::book_target []
374374
375375image::img/canvas_arc.png[alt="Two arcs with different radii",width="2.3cm"]
376376
377- endif::tex_target []
377+ endif::book_target []
378378
379379(((canvas)))(((arcTo method)))(((lineTo method)))The `arcTo` method
380380will not draw the line from the end of the rounded part to the goal
@@ -409,11 +409,11 @@ to draw a full circle.
409409</script>
410410----
411411
412- ifdef::tex_target []
412+ ifdef::book_target []
413413
414414image::img/canvas_circle.png[alt="Drawing a circle",width="4.9cm"]
415415
416- endif::tex_target []
416+ endif::book_target []
417417
418418(((moveTo method)))(((arc method)))(((path, canvas)))The resulting picture
419419contains a ((line)) from the left of the full circle (first call to
@@ -478,11 +478,11 @@ people that picked a given choice.
478478</script>
479479----
480480
481- ifdef::tex_target []
481+ ifdef::book_target []
482482
483483image::img/canvas_pie_chart.png[alt="A pie chart",width="5cm"]
484484
485- endif::tex_target []
485+ endif::book_target []
486486
487487But a chart that doesn't tell us what it means is not very helpful. We
488488would like to have a way to draw text to the ((canvas)).
@@ -644,11 +644,11 @@ set a horizontal scale and one to set a vertical scale.
644644</script>
645645----
646646
647- ifdef::tex_target []
647+ ifdef::book_target []
648648
649649image::img/canvas_scale.png[alt="A scaled circle",width="6.6cm"]
650650
651- endif::tex_target []
651+ endif::book_target []
652652
653653(((mirroring)))Scaling will cause everything about the drawn image, including the
654654((line width)), to be stretched out or squeezed together as specified.
@@ -793,11 +793,11 @@ recursion stops when the length drops below 8.
793793</script>
794794----
795795
796- ifdef::tex_target []
796+ ifdef::book_target []
797797
798798image::img/canvas_tree.png[alt="A recursive picture",width="5cm"]
799799
800- endif::tex_target []
800+ endif::book_target []
801801
802802(((save method)))(((restore method)))(((canvas)))(((rotate method)))If
803803the calls to `save` and `restore` were not there, the second recursive
@@ -1109,14 +1109,14 @@ below plugs the new display into `runGame`:
11091109
11101110endif::html_target[]
11111111
1112- ifdef::tex_target []
1112+ ifdef::book_target []
11131113
11141114(((game,screenshot)))That concludes the new ((display)) system. The
11151115resulting game looks something like this:
11161116
11171117image::img/canvas_game.png[alt="The game as shown on canvas",width="8cm"]
11181118
1119- endif::tex_target []
1119+ endif::book_target []
11201120
11211121[[graphics_tradeoffs]]
11221122== Choosing a graphics interface ==
0 commit comments