getBlockPaintPoint function

Offset getBlockPaintPoint(
  1. Offset axis,
  2. double width,
  3. double height,
  4. Alignment align
)

Calculates the real painting offset point for BlockElement.

The axis is the anchor point with the BlockElement's offset.

Implementation

Offset getBlockPaintPoint(
  Offset axis,
  double width,
  double height,
  painting.Alignment align,
) =>
    Offset(
      axis.dx - (width / 2) + ((width / 2) * align.x),
      axis.dy - (height / 2) + ((height / 2) * align.y),
    );