I need to draw rotated rectangle on Canvas.
I have x and y of top left rectangle corner and angle of rotation around that corner.
If I use context.rotate() function it will rotate canvas around (0,0).
Is it possible to rotate canvas around custom center on GWT?
I need to draw rotated rectangle on Canvas. I have x and y of
Share
Yes, use
context.translatefirst to change the origin, thus changing the “center” of rotation. (since all rotation is done about the origin). Typically you’ll want totranslateback the same amount afterwards.