[TransitionHandler]Set mouseTransparent of the whole view

, fix bug introduced in 3fb5048f10
This commit is contained in:
yushijinhun
2018-07-07 17:26:20 +08:00
parent 785790ccc4
commit 87904109ca

View File

@@ -86,7 +86,7 @@ public final class TransitionHandler implements AnimationHandler {
Timeline nowAnimation = new Timeline(); Timeline nowAnimation = new Timeline();
nowAnimation.getKeyFrames().addAll(transition.animate(this)); nowAnimation.getKeyFrames().addAll(transition.animate(this));
nowAnimation.getKeyFrames().add(new KeyFrame(duration, e -> { nowAnimation.getKeyFrames().add(new KeyFrame(duration, e -> {
previousNode.setMouseTransparent((Boolean) previousNode.getProperties().get(MOUSE_TRANSPARENT)); view.setMouseTransparent(false);
view.getChildren().remove(previousNode); view.getChildren().remove(previousNode);
})); }));
nowAnimation.play(); nowAnimation.play();
@@ -105,14 +105,12 @@ public final class TransitionHandler implements AnimationHandler {
if (previousNode == newView) if (previousNode == newView)
previousNode = NULL; previousNode = NULL;
previousNode.getProperties().put(MOUSE_TRANSPARENT, previousNode.isMouseTransparent()); view.setMouseTransparent(true);
previousNode.setMouseTransparent(true);
currentNode = newView; currentNode = newView;
view.getChildren().setAll(previousNode, currentNode); view.getChildren().setAll(previousNode, currentNode);
} }
private static final String MOUSE_TRANSPARENT = "TransitionHandler.MOUSE_TRANSPARENT";
private static final StackPane NULL = new StackPane(); private static final StackPane NULL = new StackPane();
} }