Translation
Discover how translation in Pycairo manipulates the coordinate system to move shapes within the drawing space. Learn to use the translate method to reposition graphics easily and understand how translated coordinates map between user and device spaces for flexible drawing.
We'll cover the following...
We'll cover the following...
Translation
Translation shifts the entire coordinate system. It is useful if we want to draw a shape in a different position, but without changing the drawing code.
We use the translate method of the Context to perform a translation:
ctx.translate(200, 300)
This moves the entire user space 200 units to the right, and 300 units down, relative to device space. This means ...