getNonCoveringZoomVerticalTranslation method

  1. @protected
double getNonCoveringZoomVerticalTranslation(
  1. double scale
)

Returns the translation to apply when the child is smaller than the viewport vertically.

Implementation

@protected
double getNonCoveringZoomVerticalTranslation(double scale) {
  switch (nonCoveringZoomAlignmentVertical) {
    case VerticalNonCoveringZoomAlign.top:
      return 0;
    case VerticalNonCoveringZoomAlign.middle:
      return (widgetViewport.height - (childBoundaryRect.height * scale)) / 2;
    case VerticalNonCoveringZoomAlign.bottom:
      return widgetViewport.height - (childBoundaryRect.height * scale);
  }
}