slice method

dynamic slice(
  1. TreeNodeBase node,
  2. double left,
  3. double top,
  4. double right,
  5. double bottom,
)

Implementation

slice(
    TreeNodeBase node, double left, double top, double right, double bottom) {
  var k = (bottom - top) / node.value!;

  for (var child in node.children!) {
    child.left = left;
    child.top = top;
    child.right = right;
    child.bottom = top += child.value * k;
  }
}