Each TransitionHandler instance uses its own empty pane

Using shared empty pane may cause some probleams
This commit is contained in:
yushijinhun 2018-07-07 17:30:43 +08:00
parent 87904109ca
commit f259601397
No known key found for this signature in database
GPG Key ID: 5BC167F73EA558E4

View File

@ -98,12 +98,12 @@ public final class TransitionHandler implements AnimationHandler {
if (view.getWidth() > 0 && view.getHeight() > 0) {
previousNode = currentNode;
if (previousNode == null)
previousNode = NULL;
previousNode = EMPTY_PANE;
} else
previousNode = NULL;
previousNode = EMPTY_PANE;
if (previousNode == newView)
previousNode = NULL;
previousNode = EMPTY_PANE;
view.setMouseTransparent(true);
@ -112,5 +112,5 @@ public final class TransitionHandler implements AnimationHandler {
view.getChildren().setAll(previousNode, currentNode);
}
private static final StackPane NULL = new StackPane();
private final StackPane EMPTY_PANE = new StackPane();
}