JavaFX : Rotated animation delay between cycles

后端 未结 2 409
南笙
南笙 2021-01-18 10:16

I\'ve created an animation for an ImageView based on a RotatedTranstion using the following code :

ImageView icon = ImageCache.getImage(\"refresh.png\");
Ro         


        
2条回答
  •  北海茫月
    2021-01-18 10:56

    The apparent pause between each cycle is caused by the interpolator, which by default uses Interpolator.EASE_BOTH (so it decelerates at the end of each cycle and accelerates at the beginning).

    To remove this, just set the interpolator to Interpolator.LINEAR:

    rotateTransition.setInterpolator(Interpolator.LINEAR);
    

提交回复
热议问题