Class PinchToZoomGesture

  • All Implemented Interfaces:
    GestureHandler

    public class PinchToZoomGesture
    extends Object
    implements GestureHandler
    2 pointer zoom, a.k.a. pinch to zoom, gesture handler processing MouseEvents while producing PinchToZoomGesture.ZoomEvents if gesture is completed.

    Zoom value lies within [0..2], with 1 as 1:1.

       - choosing the smallest surface edge (width/height -> x/y)
       - tolerating other fingers to be pressed and hence user to add functionality (scale, ..)
     
    • Field Detail

      • DEBUG

        public static final boolean DEBUG
    • Constructor Detail

      • PinchToZoomGesture

        public PinchToZoomGesture​(NativeSurface surface,
                                  boolean allowMorePointer)
        Parameters:
        surface - the NativeSurface, which size is used to compute the relative zoom factor
        allowMorePointer - if false, allow only 2 pressed pointers (safe and recommended), otherwise accept other pointer to be pressed.