render method

  1. @override
void render(
  1. RenderState renderState
)
override

Renders this display object with the given renderState. The display object is rendered without its filters.

Implementation

@override
void render(RenderState renderState) {
  final globalMatrix = renderState.globalMatrix;
  final globalAlpha = renderState.globalAlpha;
  final visibility = visible && off == false;
  final stage = this.stage;
  final pixelRatio = stage != null ? stage.pixelRatio : 1.0;

  final ma = (globalMatrix.a / pixelRatio).toStringAsFixed(4);
  final mb = (globalMatrix.b / pixelRatio).toStringAsFixed(4);
  final mc = (globalMatrix.c / pixelRatio).toStringAsFixed(4);
  final md = (globalMatrix.d / pixelRatio).toStringAsFixed(4);
  final mtx = (globalMatrix.tx / pixelRatio).toStringAsFixed(4);
  final mty = (globalMatrix.ty / pixelRatio).toStringAsFixed(4);

  final styleOpacity = globalAlpha.toStringAsFixed(4);
  final styleTransform = 'matrix($ma,$mb,$mc,$md,$mtx,$mty)';
  final styleVisibility = visibility ? 'visible' : 'hidden';

  if (_styleVisibility != styleVisibility) {
    _style.visibility = _styleVisibility = styleVisibility;
  }

  if (_styleOpacity != styleOpacity) {
    _style.opacity = _styleOpacity = styleOpacity;
  }

  if (_styleTransform != styleTransform) {
    _style.transform = _styleTransform = styleTransform;
  }
}