collectRects method

  1. @visibleForTesting
Float64List collectRects()

Screen rects of the visible wrappers, [left, top, width, height, ...].

Implementation

@visibleForTesting
Float64List collectRects() {
  final geometry = _GeometryCache();
  final values = <double>[];
  for (final box in _boxes) {
    final rect = geometry.visibleRect(box);
    if (rect == null) continue;
    final left = rect.left.floorToDouble();
    final top = rect.top.floorToDouble();
    values
      ..add(left)
      ..add(top)
      ..add(rect.right.ceilToDouble() - left)
      ..add(rect.bottom.ceilToDouble() - top);
  }
  return Float64List.fromList(values);
}