add method

void add(
  1. Node node
)

Implementation

void add(Node node) {
  nodes!.add(node);

  if (nodes!.length == 1) {
    rect = Rect.fromLTRB(node.x, node.y, node.x + node.width, node.y + node.height);
  } else {
    rect = Rect.fromLTRB(min(rect!.left, node.x), min(rect!.top, node.y), max(rect!.right, node.x + node.width),
        max(rect!.bottom, node.y + node.height));
  }
}