isRepaintBoundary property

bool get isRepaintBoundary
inherited

Whether should as a repaintBoundary for this element when style changed

Implementation

bool get isRepaintBoundary {
  // Following cases should always convert to repaint boundary for performance consideration.
  // Intrinsic element such as <canvas>.
  if (_isDefaultRepaintBoundary || _forceToRepaintBoundary) return true;

  // Overflow style.
  bool hasOverflowScroll = renderStyle.overflowX == CSSOverflowType.scroll || renderStyle.overflowX == CSSOverflowType.auto ||
    renderStyle.overflowY == CSSOverflowType.scroll || renderStyle.overflowY == CSSOverflowType.auto;
  // Transform style.
  bool hasTransform = renderStyle.transformMatrix != null;
  // Fixed position style.
  bool hasPositionedFixed = renderStyle.position == CSSPositionType.fixed;

  return hasOverflowScroll || hasTransform || hasPositionedFixed;
}