onScroll method

  1. @override
void onScroll(
  1. PointerScrollInfo info
)

Implementation

@override
void onScroll(PointerScrollInfo info) {
  var vf = camera.viewfinder;
  var opg = vf.localToGlobal(Vector2.zero());
  var oz = vf.zoom;
  var zoomDelta = info.scrollDelta.global.y.sign * zoomPerScrollUnit;
  vf.zoom += zoomDelta;
  clampZoom();

  if (vf.zoom <= options.scaleRange.x || vf.zoom >= options.scaleRange.y) {
    return;
  }

  keepMousePosition(info, opg, zoomDelta, vf, oz);
}