Skip to content

Commit d365185

Browse files
committed
on smooth end added
1 parent 9e4f298 commit d365185

File tree

1 file changed

+7
-0
lines changed
  • sceneview/src/main/java/io/github/sceneview/node

1 file changed

+7
-0
lines changed

sceneview/src/main/java/io/github/sceneview/node/Node.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ open class Node(val engine: Engine) : NodeParent, TransformProvider,
348348

349349
var smoothTransform: Transform? = null
350350

351+
var onSmoothEnd: ((node: Node) -> Unit)? = null
352+
351353
/**
352354
* ### The node can be selected when a touch event happened
353355
*
@@ -477,6 +479,7 @@ open class Node(val engine: Engine) : NodeParent, TransformProvider,
477479
} else {
478480
this.transform = smoothTransform
479481
this.smoothTransform = null
482+
onSmoothEnd()
480483
}
481484
} else {
482485
this.smoothTransform = null
@@ -688,6 +691,10 @@ open class Node(val engine: Engine) : NodeParent, TransformProvider,
688691
smoothTransform = transform
689692
}
690693

694+
open fun onSmoothEnd() {
695+
onSmoothEnd?.invoke(this)
696+
}
697+
691698
fun animatePositions(vararg positions: Position): ObjectAnimator =
692699
NodeAnimator.ofPosition(this, *positions)
693700

0 commit comments

Comments
 (0)