getScrollMetricsH method

ScrollMetrics getScrollMetricsH(
  1. Matrix4 transform,
  2. Size viewport,
  3. Size content
)

Implementation

ScrollMetrics getScrollMetricsH(
    Matrix4 transform, Size viewport, Size content) {
  double scale = transform.getScaleOnZAxis();
  Vector3 translation = transform.getTranslation();
  return FixedScrollMetrics(
    minScrollExtent: 0,
    maxScrollExtent: math.max(scale * content.width - viewport.width, 0),
    pixels: -translation.x,
    viewportDimension: viewport.width,
    axisDirection: horizontalScrollbar.textDirection == TextDirection.ltr
        ? AxisDirection.right
        : AxisDirection.left,
    devicePixelRatio: devicePixelRatio,
  );
}