Unexpected rotation on multi-layered SpriteMap

Let’s not break backwards compatibility. There is little to no information what “rotated” means so I guess I have to change the way it rotates the sprite. Would you mind to help me out with this and tell me how is it supposed to be so I don’t have to look it up? Is it 90CW or 90CCW, or whatever else? Thanks!

EDIT:
I’ve figured it out, hopefully :smiley:
Changes committed.

So this is the current status
Not rotated:
image

Rotated:
image

So it rotates CCW 90.

New, not rotated:
image

New, rotated:
image

CCW 90.

Should be OK!