registerSelectableRegion method

  1. @override
void registerSelectableRegion(
  1. Rect region, {
  2. int zIndex = 0,
})
override

Registers a selectable rectangular region in buffer coordinates with optional zIndex.

Implementation

@override
void registerSelectableRegion(Rect region, {int zIndex = 0}) {
  if (region.width <= 0 || region.height <= 0) return;
  final clipped = bounds.intersect(
    Rect(
      bounds.x + region.x,
      bounds.y + region.y,
      region.width,
      region.height,
    ),
  );
  if (clipped.width > 0 && clipped.height > 0) {
    parent.registerSelectableRegion(clipped, zIndex: zIndex);
  }
}