Correcting Unequal Scaling
Explore how to correct unequal scaling effects in Pycairo by using translation and scale transforms centered on specific points. Learn to draw ellipses precisely and apply save and restore functions to prevent stroke and fill distortions caused by scaling, improving your vector graphics drawing skills.
We'll cover the following...
Before we learn how to correct unequal scaling, we will make an ellipse.
Placing an ellipse
If we want to scale a shape using a specific center of enlargement, we will use the same trick we used to set the center of rotation. We will use this to place an ellipse on the page. We will draw an ellipse with a width of 400 and a height of 200, centered on the point (300, 350). This is the code required to draw this ellipse:
The first part of this code uses translate ...