getBoundBox method

Rect getBoundBox()

Implementation

Rect getBoundBox() {
  num left = x;
  num right = x;
  num top = y;
  num bottom = y;
  this.each((node, index, startNode) {
    left = min(left, node.x);
    top = min(top, node.y);
    right = max(right, node.x);
    bottom = max(bottom, node.y);
    return false;
  });
  return Rect.fromLTRB(left.toDouble(), top.toDouble(), right.toDouble(), bottom.toDouble());
}