Article introduction of Wulin.com (www.vevb.com): The application of the Canvas tag of HTML5 Daily Training - the use of coordinate transformation and path.
So far, we have learned a lot of Canvas drawing methods. What if we want to draw a graph?
We need to deform the rectangle, and using coordinate transformation is enough. However, when changing the graphics drawn using paths, there are many things to consider. Because after using coordinate transformation, the path that has been created is unavailable. The path must be recreated. After the path is recreated, the coordinate transformation method fails again.
Solution
1. Another function that creates the path must be drawn first.
2. Call this function while the coordinates change.
Code Case