drawRotated method
void
drawRotated({
- required Size size,
- Offset rotationOffset = Offset.zero,
- Offset drawOffset = Offset.zero,
- required double angle,
- required DrawCallback drawCallback,
Handles performing multiple draw actions rotated.
Implementation
void drawRotated({
required Size size,
Offset rotationOffset = Offset.zero,
Offset drawOffset = Offset.zero,
required double angle,
required DrawCallback drawCallback,
}) {
save();
translate(
rotationOffset.dx + drawOffset.dx + size.width / 2,
rotationOffset.dy + drawOffset.dy + size.height / 2,
);
rotate(Utils().radians(angle));
translate(
-drawOffset.dx - size.width / 2,
-drawOffset.dy - size.height / 2,
);
drawCallback();
restore();
}