renderSpriteByRadAngle function
void
renderSpriteByRadAngle(})
Implementation
void renderSpriteByRadAngle(
Canvas canvas,
double radAngle,
Rect rect,
Sprite sprite, {
Paint? overridePaint,
}) {
canvas.save();
canvas.translate(rect.center.dx, rect.center.dy);
canvas.rotate(radAngle == 0.0 ? 0.0 : radAngle + (pi / 2));
canvas.translate(-rect.center.dx, -rect.center.dy);
sprite.render(
canvas,
position: rect.positionVector2,
size: rect.sizeVector2,
overridePaint: overridePaint,
);
canvas.restore();
}