Skip to content

Incorrect documentation for InteractionTracker #100

@Youssef1313

Description

@Youssef1313

Page: https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.interactions.interactiontracker?view=windows-app-sdk-1.3

The Idle → Inertia transition doc says:

This state transition only happens when the InteractionTracker is in the Idle state and TryUpdatePositionWithVelocity or TryUpdateScaleWithVelocity is called.

However, given:

            var interactionTracker = InteractionTracker.CreateWithOwner(_visual.Compositor, new MyOwner());
            interactionTracker.MinPosition = new(-1000);
            interactionTracker.MaxPosition = new(1000);
            var vis = VisualInteractionSource.Create(_visual);

            interactionTracker.InteractionSources.Add(vis);

            vis.ManipulationRedirectionMode = VisualInteractionSourceRedirectionMode.CapableTouchpadAndPointerWheel;
            vis.PositionXSourceMode = InteractionSourceMode.EnabledWithoutInertia;
            vis.PositionYSourceMode = InteractionSourceMode.EnabledWithoutInertia;

Just scrolling with mouse wheel will cause Idle → Inertia transition. There are no TryUpdatePositionWithVelocity calls involved.

Also, the method name is TryUpdatePositionWithAdditionalVelocity, so that's a typo as well.

NOTE: When Idle transitions to Inertia with mouse wheel, the request id is always zero, indicating that it doesn't involve TryUpdatePositionWithAdditionalVelocity. Because:

https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.composition.interactions.interactiontracker.tryupdatepositionwithadditionalvelocity?view=windows-app-sdk-1.4

Returns the request ID. On state transitions, the request which caused the change in state will be included in the args. These IDs will start at 1 and increase with each try call during the lifetime of the application.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions