paintChild method

  1. @protected
FlagParentBounds? paintChild(
  1. Canvas canvas,
  2. Rect parentBounds,
  3. ElementsProperties? child
)

Implementation

@protected
FlagParentBounds? paintChild(
  Canvas canvas,
  Rect parentBounds,
  ElementsProperties? child,
) {
  final childShape = child?.shape;
  if (childShape == null || child == null) return null;

  final shapePainter = painter(childShape);
  final parent = parentBounds.size;

  canvas
    ..save()
    ..translate(parentBounds.left, parentBounds.top);
  final res = shapePainter([child], parent.aspectRatio).paint(canvas, parent);
  canvas.restore();

  return res;
}