Vixen
02b45cc4
csharp
public sealed class TransformEvent

Two pointers moving relative to each other: a pinch, a rotation, or both at once.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ One event carrying both scale and rotation, rather than a pinch event and a rotate event. They are computed from the same pair of pointers on the same frame and cannot occur apart — two fingers that change their separation almost always change their angle a little as well. Split into two streams, every handler that cares about both would have to correlate them, and every handler that cares about one would have to decide what to do about the other. This is what the web does with gesturechange, for the same reason.

Cumulative and incremental, both. Scale and Rotation are measured against where the fingers started, which is what a view being transformed wants; the Delta pair is the change since the last event, which is what something integrating a velocity wants. DragEvent carries the same pair for the same reason, and deriving either from the other at the call site loses precision to accumulated rounding.

Fields and properties (12)

  • public int FirstPointerId

    The pointer that was already down.

  • public int SecondPointerId

    The pointer that joined it.

  • public TransformStage Stage

    How far along the gesture is.

  • public float X

    Halfway between the two pointers, in document space.

  • public float Y

    Ditto.

  • public float DeltaX

    How far that midpoint moved since the last event.

  • public float DeltaY

    Ditto.

  • public float Scale

    How far apart the pointers are now, over how far apart they started.

  • public float Rotation

    How far the line between them has turned since the start, in radians, clockwise.

  • public float DeltaScale

    How much Scale was multiplied by since the last event.

  • public float DeltaRotation

    How much Rotation changed since the last event.

  • public ModifierKeys Modifiers

    What was held at the time.

Used by (2)

  • GestureRecognizerVixen.Ui
  • TransformTestsVixen.Ui.Testing.Tests