using HTML5 Canvas – rotate image about arbitrary point
In general, what you want to do is: Transform the context to the point on the canvas that the object should rotate about. Rotate the context. Transform the context by the negative offset within the object for the center of rotation. Draw the object at 0,0. In code: ctx.save(); ctx.translate( canvasRotationCenterX, canvasRotationCenterY ); ctx.rotate( rotationAmountInRadians … Read more