paintFixedChildren method

void paintFixedChildren(
  1. double scrollOffset,
  2. AxisDirection axisDirection
)
inherited

Normally element in scroll box will not repaint on scroll because of repaint boundary optimization So it needs to manually mark element needs paint and add scroll offset in paint stage

Implementation

void paintFixedChildren(double scrollOffset, AxisDirection axisDirection) {
  RenderLayoutBox? _scrollingContentLayoutBox = scrollingContentLayoutBox;
  // Only root element has fixed children
  if (targetId == HTML_ID && _scrollingContentLayoutBox != null) {
    for (RenderBoxModel child in _scrollingContentLayoutBox.fixedChildren) {
      // Save scrolling offset for paint
      if (axisDirection == AxisDirection.down) {
        child.scrollingOffsetY = scrollOffset;
      } else if (axisDirection == AxisDirection.right) {
        child.scrollingOffsetX = scrollOffset;
      }
    }
  }
}