setPixels method
Returns the value that finally reflected newPixels.
Implementation
double setPixels(double newPixels) {
final double oldPixels = pixels;
final double normalized = newPixels < 0 ? 0 : newPixels / extent;
offset = normalized.abs().clamp(0, 1);
return oldPixels - pixels;
}