selectedStart method

  1. @override
bool selectedStart(
  1. DrawPencil object,
  2. Offset focalPoint,
  3. Matrix4 transform,
  4. Size size,
)
override

Returning false will cancel the selection of the object, in which case selectedUpdate() and selectedEnd() will not be called for the same interaction.

Useful for resize handles or moving the object.

Implementation

@override
bool selectedStart(
  DrawPencil object,
  Offset focalPoint,
  Matrix4 transform,
  Size size,
) {
  if (object.getHitboxes(size).any((hitbox) => hitbox.contains(focalPoint))) {
    object.prepareDragHandle(focalPoint);
    return true;
  }
  return false;
}