@@ -26,7 +26,7 @@ arbitrary points, are extremely awkward to do with regular
2626((HTML)) elements.
2727
2828(((SVG)))(((img (HTML tag))))There are two alternatives. The first is DOM-based
29- but utilizes Scalable Vector Graphics (SVG), rather than HTML
29+ but utilizes _Scalable Vector Graphics (SVG)_ , rather than HTML
3030elements. Think of SVG as a dialect for describing
3131((document))s that focuses on ((shape))s rather than text. You can embed an SVG
3232document in an HTML document, or you can include it
@@ -114,7 +114,7 @@ three-dimensional graphics through the OpenGL interface.
114114WebGL. We stick to two dimensions. But if you are interested in
115115three-dimensional graphics, I do encourage you to look into WebGL. It
116116provides a very direct interface to modern graphics hardware and thus
117- allows you to render even complicated scenes efficiently—from
117+ allows you to render even complicated scenes efficiently, using
118118JavaScript.
119119
120120(((getContext method)))(((canvas,context)))A ((context)) is created
@@ -145,7 +145,7 @@ endif::book_target[]
145145
146146(((SVG)))(((coordinates)))Just like in ((HTML)) (and SVG), the
147147coordinate system that the canvas uses puts (0,0) at the top-left
148- corner, and the positive y-((axis)) goes down from there. So, (10,10)
148+ corner, and the positive y-((axis)) goes down from there. So (10,10)
149149is 10 pixels below and to the right of the top-left corner.
150150
151151[[fill_stroke]]
@@ -157,12 +157,12 @@ or it can be _stroked_, which means a ((line)) is drawn along its edge. The
157157same terminology is used by SVG.
158158
159159(((fillRect method)))(((strokeRect method)))The `fillRect` method fills
160- a ((rectangle)). It takes first the x and y ((coordinates)) of the
160+ a ((rectangle)). It takes first the x- and y- ((coordinates)) of the
161161rectangle's top-left corner, then its width, and then its height. A
162162similar method, `strokeRect`, draws the ((outline)) of a rectangle.
163163
164164(((property)))(((state)))Neither method takes any further parameters.
165- The color of the fill, thickness of the stroke, and so on, are not
165+ The color of the fill, thickness of the stroke, and so on are not
166166determined by an argument to the method (as you might justly expect)
167167but rather by properties of the context object.
168168
@@ -199,7 +199,7 @@ endif::book_target[]
199199
200200(((default value)))(((canvas,size)))When no `width` or `height`
201201attribute is specified, as in the previous example, a canvas element
202- gets a default width of 300 and height of 150 pixels.
202+ gets a default width of 300 pixels and height of 150 pixels.
203203
204204== Paths ==
205205
@@ -317,7 +317,7 @@ endif::book_target[]
317317
318318(((stroke method)))We draw a ((quadratic curve)) from the left to the
319319right, with (60,10) as control point, and then draw two ((line))
320- segments, going through that control point and back to the start of
320+ segments going through that control point and back to the start of
321321the line. The result somewhat resembles a _((Star Trek))_ insignia. You
322322can see the effect of the control point: the lines leaving the lower
323323corners start off in the direction of the control point and then
@@ -390,7 +390,7 @@ start of the rounded part.
390390
391391ifdef::book_target[]
392392
393- This produces two rounded corners with different radiuses .
393+ This produces two rounded corners with different radii .
394394
395395image::img/canvas_arc.png[alt="Two arcs with different radii",width="2.3cm"]
396396
@@ -888,7 +888,7 @@ CanvasDisplay.prototype.clear = function() {
888888(((CanvasDisplay type)))The `animationTime` counter is the reason we
889889passed the step size to `drawFrame` in
890890link:15_game.html#domdisplay[Chapter 15], even though `DOMDisplay`
891- does not use it. Our new `drawFrame` function uses it to track time
891+ does not use it. Our new `drawFrame` function uses the counter to track time
892892so that it can switch between ((animation)) ((frame))s based on the
893893current time.
894894
@@ -948,8 +948,8 @@ CanvasDisplay.prototype.updateViewport = function() {
948948
949949(((boundary)))(((Math.max function)))(((Math.min function)))(((clipping)))The calls
950950to `Math.max` and `Math.min` ensure that the viewport does
951- not end up showing space outside of the level. `Math.max(x, 0)` has
952- the effect of ensuring the resulting number is not less than zero.
951+ not end up showing space outside of the level. `Math.max(x, 0)`
952+ ensures that the resulting number is not less than zero.
953953`Math.min`, similarly, ensures a value stays below a given bound.
954954
955955When ((clearing)) the display, we'll use a slightly different
@@ -1030,7 +1030,7 @@ serious problem. Since we keep updating the screen, the correct scene
10301030will appear as soon as the loading finishes.
10311031
10321032(((player character)))(((animation)))(((drawing)))The ((walking))
1033- character we used before will be used to represent the player. The
1033+ character shown earlier will be used to represent the player. The
10341034code that draws it needs to pick the right ((sprite)) and direction
10351035based on the player's current motion. The first eight sprites contain a
10361036walking animation. When the player is moving along a floor, we cycle
0 commit comments