hitTestHandle method
int?
hitTestHandle(
- Offset pos,
- Rect bounds,
- PriceRange priceRange,
- CoordinateConverter converter, {
- double threshold = 12.0,
Checks if pos falls within threshold pixels of any handle on this drawing.
Implementation
int? hitTestHandle(
Offset pos,
Rect bounds,
PriceRange priceRange,
CoordinateConverter converter, {
double threshold = 12.0,
}) {
final handles = getHandleOffsets(bounds, priceRange, converter);
for (int i = 0; i < handles.length; i++) {
if ((pos - handles[i]).distance <= threshold) {
return i;
}
}
return null;
}