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;
  var y = graphicContext.position.y;

  if (backgroundColor != null) {
    pCanvas.fillRect(
        x, y, width, height, PStyle(color: graphicContext.backgroundColor));
  }

  for (var e in elements) {
    e.paint(pCanvas, graphicContext);
  }
}