fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.37k stars 354 forks source link

How to use RotateAbout(rad, x, y) only for a specific object? #104

Open tagaism opened 4 years ago

tagaism commented 4 years ago

Hello everyone! I have a very basic question. When I use RotateAbout(rad, x, y) to one object all objects start to rotate around x, y point. How to use RotateAbout only for a specific object? I believe I must use Push() and Pop() function to preserve and to retrieve the context state. But it doesn't seem to be worked and I can't figure out how to do that.

HeCorr commented 3 years ago

(Edit: sorry! I didn't know about Identity.)

You can use Identity to reset all transformations (including rotation).

If you don't want to reset anything other than the rotation, just rotate it the other way after drawing the object. ;)