onScaleUpdate method
Called when a scale gesture updates. Usually you would not want to override this
Implementation
void onScaleUpdate(ScaleUpdateDetails details) {
// uses usual display conventions and final vector postion - initial vector position
// convention is that if I drag from right to left, dx is negative
// for top to bottom, dy is postive
// scale + offset => scale then offset
if (details.scale != 1) _scaledDuringGesture = true;
final newScale = _clampScale(_baseScale * details.scale);
if (newScale != _scale) {
_scaledDuringGesture = true;
_gsTopLeftOffset = newGsTopLeftOnScaling(
_gsTopLeftOffset,
details.localFocalPoint - details.focalPointDelta,
_scale,
newScale,
);
_scale = newScale;
}
if (details.focalPointDelta != Offset.zero) {
// if ss distnace is x, and zoom is 2x, gs only moves by x/2
_gsTopLeftOffset -= details.focalPointDelta / _scale;
}
markDirty();
}