keepMousePosition method

void keepMousePosition(
  1. PointerScrollInfo info,
  2. Vector2 opg,
  3. double zoomDelta,
  4. Viewfinder vf,
  5. double oz,
)

Implementation

void keepMousePosition(PointerScrollInfo info, Vector2 opg, double zoomDelta,
    Viewfinder vf, double oz) {
  var wp = info.eventPosition.widget;
  var wpg = wp - opg;
  var wpgDelta = wpg * zoomDelta;
  var npg = vf.localToGlobal(Vector2.zero());
  vf.position += (npg - opg + wpgDelta / oz) / vf.zoom;
}