showSpriteStroke method
Implementation
void showSpriteStroke(Color color, double width, {Vector2? offset}) {
if (_strockePaint != null &&
_strokeWidth == width &&
_strockePaint?.color == color) {
return;
}
_strokeWidth = width;
_strokePosition = Vector2.all(-_strokeWidth);
if (offset != null) {
_strokePosition += offset;
}
_strokeSize = Vector2(
size.x + _strokeWidth * 2,
size.y + _strokeWidth * 2,
);
_strockePaint = Paint()
..color = color
..colorFilter = ColorFilter.mode(
color,
BlendMode.srcATop,
);
}