Find the center of any shape-Summary, shape center Summary
Rotating and scaling a rectangle or other shape is very similar to scaling a square. In fact, you only need to translate the origin point to the center of the shape before scaling, rotating, or combining scaling, you can get the desired effect. Remember, the center of any shape is a half-width X value and a half-height Y value! This requires the use of the boundary box theory to find the center point.
PS is ugly! But I said that I am trying to learn sketch! Next year, I will take an exam at the art department HOHO (PS: I have already been a computer undergraduate. I think I'm sure I'm kneeling. I mean I have always done a lot of work! But they all look at me with contempt! The world view of the King cannot be understood by ordinary people! I want to come to Shanghai Railway Station to queue up)
In addition, the demo I wrote mainly refers to the HTML5 canvas development details book! You can also buy it.
The cover of the book is KAKA bird from New Zealand !... It's almost extinct. (the terrible human, the spirit of GaAs is estimated to be dispatched)