1

私はこのコードを持っています:

  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;

ただし、ズームは 2 本の指を使用するため、1 本の指がもう一方の指よりも少し前に離されると、パンがめちゃくちゃになることがあります (画像がパンされている間にズームを実行している「最後の」指に画像がジャンプします)。

それを解決する方法はありますか?

4

0 に答える 0