paint method

  1. @override
void paint(
  1. PCanvas pCanvas, [
  2. GraphicContext? graphicContext
])
override

Implementation

@override
void paint(PCanvas pCanvas, [GraphicContext? graphicContext]) {
  graphicContext = resolveGraphicContext(graphicContext);

  var x = graphicContext.position.x + this.x;
  var y = graphicContext.position.y + this.y;

  pCanvas.fillRect(
      x, y, width, height, PStyle(color: graphicContext.backgroundColor));

  var strokeSize = this.strokeSize;
  if (strokeSize != null) {
    pCanvas.strokeRect(
        x, y, width, height, PStyle(color: graphicContext.color));
  }
}