Typhon0 / AnimateFX

A library of +70 ready-to-use animations for JavaFX
Apache License 2.0
451 stars 66 forks source link

Stop method doesn't reset the node to its default position #13

Closed averroes96 closed 4 years ago

averroes96 commented 4 years ago

Description

I'm trying to animate a field using methods onKeyPressed, onKeyTyped and onKeyReleased so that whenever the entered value is invalid or wrongly typed, it basically starts an animation indicating that you're making an error, but once the entered value is valid i basically call the stop method to end the animation but sometimes it stops the field in a different position than the his initial postion. i looked if there's another method that do reset the field to its initial postion but found none.

Typhon0 commented 4 years ago

Hi, you can use this function : setResetOnFinished(true). It will reset the node position when it's finished or when you call stop()

averroes96 commented 4 years ago

I basically tried this one earlier, just after instanciating the animation :

AnimateFX animField = new Shake(field);
animField.setResetOnFinished(true)

Still didn't work.

Typhon0 commented 4 years ago

Fixed with commit 8e899e1