Skip to content

Commit

Permalink
Hiding setter for Animation.isRunning.
Browse files Browse the repository at this point in the history
Closes #318.
  • Loading branch information
dominikmaeckel committed Aug 5, 2022
1 parent 19967d1 commit bb0d027
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sealed class Animation(val duration: Int) {

/** [Boolean] indicating whether the [Animation] is currently running. */
var isRunning: Boolean = false
internal set

/** Gets invoked when [Animation] has finished. */
var onFinished: ((AnimationFinishedEvent) -> Unit)? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ object AnimationBuilder {

/** Removes [anim] from animations list and invokes [Animation.onFinished]. */
private fun onFinished(scene: Scene<out ComponentView>, anim: Animation) {
scene.animations.remove(anim)
scene.animations.remove(anim.also { it.isRunning = false })

Platform.runLater { anim.onFinished?.invoke(AnimationFinishedEvent()) }
}
Expand Down

0 comments on commit bb0d027

Please sign in to comment.