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

The attribute 'scale' couldn't be change in Tween #1883

Open
AIMAI3PIKUSERU opened this issue Jan 26, 2025 · 0 comments
Open

The attribute 'scale' couldn't be change in Tween #1883

AIMAI3PIKUSERU opened this issue Jan 26, 2025 · 0 comments

Comments

@AIMAI3PIKUSERU
Copy link

AIMAI3PIKUSERU commented Jan 26, 2025

I am trying to implement a hover animation for a Konva.Rect. The goal is to scale the rectangle to 1.5x when the cursor hovers over it and return it to its original size when the cursor moves away.

Initially, I attempted this using Konva.Animation, but I found it challenging to reset the rectangle to its original size upon cursor exit. I then tried Konva.Tween and created two tween objects for the mouse enter and exit animations. Unfortunately, it still didn't work as expected.

After further research, I discovered the Shape.to() method, which is described as an alternative way to achieve tweens in the official documentation. While it worked in the example provided by ChatGPT, changing the property from scaleX to scale caused issues again.

Could you clarify:

  1. Why does using scale cause issues?

  2. What is the best practice for implementing hover animations with Konva?

Thank you for your help!

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

No branches or pull requests

1 participant