Delphi iOS zoom + panorama at the same time (two fingers do not release the screen at the same time)

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?

+1
source share

Source: https://habr.com/ru/post/949613/


All Articles