renderRotated method
Utility method to render stuff rotated at specific angle.
It rotates the canvas around the center of rotation. The changes are reset after the fn is run.
Implementation
void renderRotated(
double angle,
Vector2 rotationCenter,
void Function(Canvas) fn,
) {
save();
translateVector(rotationCenter);
rotate(angle);
translateVector(-rotationCenter);
fn(this);
restore();
}