clampX method

double clampX(
  1. double x,
  2. double zoomRatio
)

Clamp horizontal scroll position into valid range.

Implementation

double clampX(double x, double zoomRatio) =>
    x.clamp(0.0, getScrollableMaxX(zoomRatio));