drawRoundRect method
void
drawRoundRect()
Implementation
void drawRoundRect(
int x,
int y,
int width,
int height,
int borderRadius,
ui.Color color,
double thickness,
) {
_changed = true;
final halfThickness = (thickness / 2).round().clamp(0, 999999);
final rrect = ui.RRect.fromRectAndRadius(
ui.Rect.fromLTWH(
(x + halfThickness).toDouble(),
(y + halfThickness).toDouble(),
(width - halfThickness * 2).toDouble(),
(height - halfThickness * 2).toDouble(),
),
ui.Radius.circular(borderRadius.toDouble()),
);
_canvas.drawRRect(rrect, _paint(color, strokeWidth: thickness));
}