changeset 5593:fb3a8f1fc155

Ensemble8: Fix for RT-33966 Timeline Events sample affects BendingPages effect due to animated bounds
author Alexander Kouznetsov
date Wed, 30 Oct 2013 20:25:59 -0700
parents fee91394294a
children c49d69f83da6
files apps/samples/Ensemble8/src/samples/java/ensemble/samples/animation/timeline/timelineevents/TimelineEventsApp.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/apps/samples/Ensemble8/src/samples/java/ensemble/samples/animation/timeline/timelineevents/TimelineEventsApp.java	Wed Oct 30 20:13:10 2013 -0700
+++ b/apps/samples/Ensemble8/src/samples/java/ensemble/samples/animation/timeline/timelineevents/TimelineEventsApp.java	Wed Oct 30 20:25:59 2013 -0700
@@ -41,6 +41,7 @@
 import javafx.scene.Parent;
 import javafx.scene.Scene;
 import javafx.scene.effect.Lighting;
+import javafx.scene.layout.Pane;
 import javafx.scene.layout.StackPane;
 import javafx.scene.paint.Color;
 import javafx.scene.shape.Circle;
@@ -103,7 +104,7 @@
         EventHandler<ActionEvent> onFinished = new EventHandler<ActionEvent>() {
             @Override
             public void handle(ActionEvent t) {
-                 stack.setTranslateX(java.lang.Math.random()*200-100);
+                 stack.setTranslateX(java.lang.Math.random() * 200);
                  //reset counter
                  i = 0;
             }
@@ -111,7 +112,10 @@
         KeyFrame keyFrame = new KeyFrame(duration, onFinished , keyValueX, keyValueY);
         //add the keyframe to the timeline
         timeline.getKeyFrames().add(keyFrame);
-        return stack;
+        Pane pane = new Pane(stack);
+        pane.setPrefSize(260, 60);
+        pane.setMaxSize(Pane.USE_PREF_SIZE, Pane.USE_PREF_SIZE);
+        return pane;
     }
 
      public void play() {