|
Adding rotation and flipping |
Posted by at on Apr-03-2018 13:39 |
|
Hi Peter, I modified the code here and added a text on every square and then called hlip()/vflip() after rotate. How can I make it such that the text will always be readable i.e. will not be rotated and/or flipped?
Attached is the output image and the modified code.
Thanks.
|
Re: Adding rotation and flipping |
Posted by Peter Kwan on Apr-03-2018 20:15 |
|
Hi at,
You can draw the text after the rotation and flipping. In this way, the text will not be rotated or flipped and will always be upright. You can use simple coordinate transformation to determine the position of the text after rotation and flipping. I have attached an example for your reference.
For the flipping, you also need to "flip" the axis at the bottom-left corner and also the Javascript tooltips. So it is better to set a parameter for flipping (in the code, it is $hFlip) so all the code can flip at the same time.
Hope this can help.
Regards
Peter Kwan
|
Re: Adding rotation and flipping |
Posted by at on Apr-04-2018 15:12 |
|
Thanks Peter, I was just hoping if there's an undocumented API to rotate and flip the text itself just to avoid looping again. |
|