Skip to content

Commit 24fec6c

Browse files
committed
Clarify 'viewport' term in Chapter 16
Closes marijnh#424
1 parent 6b904ae commit 24fec6c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

16_game.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -684,14 +684,15 @@ white halo effect.
684684

685685
{{index "position (CSS)", "max-width (CSS)", "overflow (CSS)", "max-height (CSS)", viewport, scrolling}}
686686

687-
We can't assume that the level always fits in the viewport. That is
688-
why the `scrollPlayerIntoView` call is needed—it ensures that if the
689-
level is protruding outside the viewport, we scroll that viewport to
690-
make sure the player is near its center. The following ((CSS)) gives
691-
the game's wrapping ((DOM)) element a maximum size and ensures that
692-
anything that sticks out of the element's box is not visible. We also
693-
give the outer element a relative position so that the actors inside
694-
it are positioned relative to the level's top-left corner.
687+
We can't assume that the level always fits in the _viewport_—the
688+
element into which we draw the game. That is why the
689+
`scrollPlayerIntoView` call is needed—it ensures that if the level is
690+
protruding outside the viewport, we scroll that viewport to make sure
691+
the player is near its center. The following ((CSS)) gives the game's
692+
wrapping ((DOM)) element a maximum size and ensures that anything that
693+
sticks out of the element's box is not visible. We also give the outer
694+
element a relative position so that the actors inside it are
695+
positioned relative to the level's top-left corner.
695696

696697
```{lang: "text/css"}
697698
.game {

0 commit comments

Comments
 (0)