bandFor method

int bandFor(
  1. double y
)

The horizontal band index sampling row y falls into, clamped.

Implementation

int bandFor(double y) {
  if (bandCount == 0) return 0;
  final b = ((y - minY) / bandHeight).floor();
  return b < 0 ? 0 : (b >= bandCount ? bandCount - 1 : b);
}