keepMousePosition method
void
keepMousePosition(
- PointerScrollInfo info,
- Vector2 opg,
- double zoomDelta,
- Viewfinder vf,
- 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;
}