technique

Translate-rotate-translate rotation

Rotating a Canvas 2D shape about its own center by translating to the pivot, rotating the context, then offsetting by the shape's half-dimensions before drawing at the origin.

Also called: rotate a shape around its center (Canvas 2D) · pivot rotation

What it is

How it works

Parameters & tuning

Where it’s been used

Variants & neighbours

Go deeper


Revision 1 · 1 source · Something wrong? Tell us.