adjustRectangles method

Quality? adjustRectangles(
  1. Point<num> mouse,
  2. bool click
)

Implementation

Quality? adjustRectangles(Point mouse, bool click) {
  if (!click) return null;
  if (_rectangles == null) return null;

  //print('--- adjustRectangles ---');

  var point = _getMousePointInCanvas(mouse);

  var rectangles = _rectangles.value ?? [];

  var target = nearestRectangle(rectangles, point);

  if (target == null) {
    //rectangles.add(point);
  } else {
    if (target.containsPoint(point)) {
      rectangles.remove(target);
    }
  }

  _rectangles.value = rectangles;

  return Quality.high;
}