onZoom method

void onZoom({
  1. required Vector2 zoomCenter,
  2. double zoomDelta = 0,
})

Implementation

void onZoom({required Vector2 zoomCenter, double zoomDelta = 0}) {
  var vf = camera.viewfinder;
  var opg = vf.localToGlobal(Vector2.zero());
  var oz = vf.zoom;

  if (vf.zoom + zoomDelta > 0) {
    vf.zoom += zoomDelta;
  }
  clampZoom();

  if (vf.zoom <= options.scaleRange.x || vf.zoom >= options.scaleRange.y) {
    return;
  }
  keepMousePosition(null, opg, zoomDelta, vf, oz, zoomCenter);
}