Understanding the canvas
Before studying the examples of this chapter, it is important to recapitulate the following particularities related to the graphics display:
The coordinate space refers to the place in which we draw, which is not restricted to the windows size
A
Canvas
object is a set of instructions to draw in the coordinate space, not the place we draw inAll
Widget
objects contain their ownCanvas
(canvases, which we will see later) but all of them share the same coordinate space, the one in theApp
object.
For example, if we add a rotation instruction to a specific Canvas
instance (for example, the canvas of a button), then this will also affect all the subsequent graphics instructions that are going to display graphics in the coordinate space. It doesn't matter if the graphics belong to canvases of different widgets; they all share the same coordinate space.
Therefore, we need to learn techniques to leave the coordinate space context in its original state after modifying it with...