paintFixedChildren method
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 (tagName == 'HTML' && _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;
}
}
}
}