transform property

  1. @override
List<CSSFunctionalNotation>? get transform
override

Implementation

@override
List<CSSFunctionalNotation>? get transform => _transform;
set transform (List<CSSFunctionalNotation>? value)

Implementation

set transform(List<CSSFunctionalNotation>? value) {
  // Transform should converted to matrix4 value to compare cause case such as
  // `translate3d(750rpx, 0rpx, 0rpx)` and `translate3d(100vw, 0vw, 0vw)` should considered to be equal.
  // Note this comparison cannot be done in style listener cause prevValue cannot be get in animation case.
  if (_transform == value) return;
  _transform = value;
  _transformMatrix = null;

  // Mark the compositing state for this render object as dirty
  // cause it will create new layer when transform is valid.
  if (value != null) {
    renderBoxModel?.markNeedsCompositingBitsUpdate();
  }

  // Transform effect the stacking context.
  RenderBoxModel? parentRenderer = parent?.renderBoxModel;
  if (parentRenderer is RenderLayoutBox) {
    parentRenderer.markChildrenNeedsSort();
  }

  // Transform stage are applied at paint stage, should avoid re-layout.
  renderBoxModel?.markNeedsPaint();
}