Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add useAcceleration option to PanInput #205

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

malangfox
Copy link
Contributor

@malangfox malangfox commented Oct 13, 2022

Details

bandicam 2022-10-13 19-13-05-360

animateOn option adds a new way to trigger change events by continuous animation.

Usage

const axes = new Axes({
  x: {
    range: [0, 200],
  },
  y: {
    range: [0, 200],
  },
}, {
  animateOn: "change",
});

This is an example of applying animateOn option.

How it works

Legacy behavior animateOn: "release" triggers change event directly to the destination from the input.

Newly added behavior animateOn: "change" will play the animation with the destination from the input.

animateOn: "change" uses the new changeTo method in AnimationManager.
changeTo calls _animateLoop that starts the animation set by the user and fires continuous change events.
Movement through the changeTo method does not trigger animationStart and animationEnd events.

When the input is released, the existing animation behavior works for both options triggering animationStart and animationEnd events, and the sequence of events does not change.

@@ -10,7 +10,7 @@
{
"basePath": "packages/axes/dist",
"dists": [
"demo/dist"
"packages/demo/dist"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will manage dist by version like cdn.

Check the latest and version folders.

@WoodNeck WoodNeck self-requested a review October 14, 2022 04:31
@malangfox malangfox changed the title feat: add animateOn option feat: add useAcceleration option to PanInput Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants