ImageParticle constructor
Implementation
ImageParticle({
required this.image,
Paint? paint,
Vector2? size,
super.lifespan,
}) : paint = paint ?? Paint() {
final srcWidth = image.width.toDouble();
final srcHeight = image.height.toDouble();
final destWidth = size?.x ?? srcWidth;
final destHeight = size?.y ?? srcHeight;
src = Rect.fromLTWH(0, 0, srcWidth, srcHeight);
dest =
Rect.fromLTWH(-destWidth / 2, -destHeight / 2, destWidth, destHeight);
}