paintBoxModel method

void paintBoxModel(
  1. PaintingContext context,
  2. Offset offset
)

Implementation

void paintBoxModel(PaintingContext context, Offset offset) {
  // If opacity to zero, only paint intersection observer.
  if (alpha == 0) {
    paintIntersectionObserver(context, offset, paintNothing);
  } else {
    // Apply additional paint offsets:
    // - `position: fixed`: scroll-compensation based on the effective containing block.
    // - `position: sticky`: sticky delta computed by positioned layout.
    // - others: any runtime paint adjustments.
    final Offset add = renderStyle.position == CSSPositionType.fixed
        ? getFixedScrollCompensation()
        : Offset(additionalPaintOffsetX ?? 0.0, additionalPaintOffsetY ?? 0.0);
    if (add.dx != 0.0 || add.dy != 0.0) {
      offset = offset.translate(add.dx, add.dy);
    }
    _paintFilteredContent(context, offset);
  }
}