growRight method

dynamic growRight(
  1. int width,
  2. int height
)

Implementation

growRight(int width, int height) {
  this.root = {
    'used': true,
    'x': 0,
    'y': 0,
    'width': this.root['width'] + width,
    'height': this.root['height'],
    'down': this.root,
    'right': {
      'x': this.root['width'],
      'y': 0,
      'width': width,
      'height': this.root['height'],
    }
  };
  var node = this.findNode(this.root, width, height);
  if (node != null)
    return this.splitNode(node, width, height);
  else
    return null;
}