Skip to content

Commit 035ce85

Browse files
committed
Change aberrant coordinate notation in Chapter 16
1 parent 61b4b3a commit 035ce85

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

16_canvas.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ image::img/canvas_quadraticcurve.png[alt="A quadratic curve",width="2.3cm"]
278278

279279
endif::tex_target[]
280280

281-
We draw a quadratic curve from the left to the right, with _60,10_ as
281+
We draw a quadratic curve from the left to the right, with (60,10) as
282282
control point, and then draw two line segments, going through that
283283
control point and back to the start of the line. The result somewhat
284284
resembles a Star Trek insignia. You can see the effect of the control
@@ -614,7 +614,7 @@ endif::tex_target[]
614614
Scaling will cause everything about the drawn image, including the
615615
line width, to be stretched out or squeezed together as specified.
616616
Scaling by a negative amount will flip the picture around. The
617-
flipping happens around point _0,0_, which means that it will also
617+
flipping happens around point (0,0), which means that it will also
618618
flip the direction of the coordinate system. When a horizontal scaling
619619
of -1 is applied, a shape drawn at x position 100 will end up at what
620620
used to be position -100.
@@ -638,13 +638,13 @@ previous transformations.
638638

639639
So if we translate (move) by 10 horizontal pixels twice, everything
640640
will be drawn 20 pixels to the right. If we first move the center of
641-
the coordinate system to _50,50_ and then rotate by 20 degrees (0.1π
642-
in radians), that rotation will happen _around_ point _50,50_.
641+
the coordinate system to (50,50) and then rotate by 20 degrees (0.1π
642+
in radians), that rotation will happen _around_ point (50,50).
643643

644644
image::img/transform.svg[alt="Stacking transformations",width="9cm"]
645645

646646
But if we _first_ rotated by 20 degrees, and _then_ translated
647-
by _50,50_, the translation will happen in the rotated coordinate
647+
by (50,50), the translation will happen in the rotated coordinate
648648
system, and thus produce a different orientation. The order in which
649649
transformations are applied matters.
650650

@@ -679,7 +679,7 @@ given line. The second `translate` call fixes this—it “cancels” the
679679
initial translation, and makes triangle 4 appear exactly where it
680680
should.
681681

682-
We can now draw a mirrored character at position _100,0_ by flipping
682+
We can now draw a mirrored character at position (100,0) by flipping
683683
the world around the character's vertical center:
684684

685685
[source,text/html]
@@ -1033,7 +1033,7 @@ find the offset of the correct sprite. The lava tile is found at
10331033
offset 20, and the coin sprite at 40 (two times `scale`).
10341034

10351035
We have to subtract the viewport's position when computing the actor's
1036-
position, since _0,0_ on our canvas corresponds to the top left of the
1036+
position, since (0,0) on our canvas corresponds to the top left of the
10371037
viewport, not the top left of the level. We could also have used
10381038
`translate` for this. Either way works.
10391039

@@ -1204,7 +1204,7 @@ The diamond (2) can be drawn the easy way, with a path, or the
12041204
interesting way, with a `rotate` transformation. To use rotation, you
12051205
will have to apply a trick similar to what we did in the
12061206
`flipHorizontally` function. Because you want to rotate around the
1207-
center of your rectangle, and not around the point _0,0_, you must
1207+
center of your rectangle, and not around the point (0,0), you must
12081208
first `translate` to there, then rotate, and then translate back.
12091209

12101210
For the zigzag (3) it becomes unpractical to write a new call to

0 commit comments

Comments
 (0)