pronngo
pronngo

Reputation: 840

HTML5 Canvas - how to get absolute position of an object after rotate?

Do you have any idea, how to get absolute position of an object after rotate? In Canvas, when we use context.rotate() we actually rotate everything including the x and y axes. So actually positions of each objects are the same. Isn't it right?

I need to know the absolute postion from the left top corner of an objects after any transformations. It must me possible but I don't know how. Too hard for me... please give me some advices or suggestions how to do this.

Big thanks.

Upvotes: 2

Views: 474

Answers (1)

Tom Prats
Tom Prats

Reputation: 7931

For what reason do you need it? A hack to figure it out could be just loading your canvas and inspecting it.

Otherwise you could create a couple of functions to use the rotation to calculate it.

I'm assuming you're hoping for a built in method or function that will simply give it to you but I do not know of one.

Upvotes: 1

Related Questions