I have this code:
case EventInfo.GestureID of igiZoom: begin if (not(TInteractiveGestureFlag.gfEnd in EventInfo.Flags)) then begin if (not(TInteractiveGestureFlag.gfBegin in EventInfo.Flags)) then begin W := LImage.Width + 2 * ((EventInfo.Distance - FMapsLastDistanceZoom) / 3); H := LImage.Height + 2 * ((EventInfo.Distance - FMapsLastDistanceZoom) / 3); if (W < layoutMapsContent.Width) or (H < layoutMapsContent.Height) then begin W := layoutMapsContent.Width; H := layoutMapsContent.Height; end ; LImage.Width := W; LImage.Height := H; end ; FMapsLastDistanceZoom := EventInfo.Distance; end ; end ; igiPan: begin if (not(TInteractiveGestureFlag.gfEnd in EventInfo.Flags)) then begin if (not(TInteractiveGestureFlag.gfBegin in EventInfo.Flags)) then begin LImage.Position.X := LImage.Position.X + (EventInfo.Location.X - FMapsLastPositionPan.X); LImage.Position.Y := LImage.Position.Y + (EventInfo.Location.Y - FMapsLastPositionPan.Y); end ; FMapsLastPositionPan.X := EventInfo.Location.X; FMapsLastPositionPan.Y := EventInfo.Location.Y; end ; end ; igiDoubleTap: begin UpdateMapsPosition; end ; end;
However, since the zoom uses 2 fingers, panning is sometimes confused if one finger is removed slightly in front of the other (the image moves to the βlastβ finger that zooms when the image was opened)
Is there any way to solve this?
source share