Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8106014

Timeline.time is not taken into account when Timeline.repeatCount is set to Timeline.INDEFINITE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx1.3
    • fx1.0
    • javafx
    • Java FX 1.0.1 b02
      JRE 6u10
      Windows Vista SP1

      When specifying repeatCount to be indefinite in a timeline,
      the time value is not taken into account.

      The following code:

      ===============================================
      import javafx.animation.Timeline;
      import javafx.lang.Duration.*;
      import javafx.animation.KeyFrame;

      var Number:Integer = 21;
      var dur:Duration = 21s;

      var timeline = Timeline{
          //repeatCount: 5
          repeatCount: Timeline.INDEFINITE
          autoReverse: true
          time: dur
          keyFrames: [
          at (0s) {Number => 0 },
          at (26s) {Number => 26} ],
      }
      timeline.play();

      var currentPlayHead = bind Number on replace {
      println("Number change:");
      println(Number);
      }

      ===============================================

      prints:
      Number change:
      0
      Number change:
      21
      Number change:
      0
      Number change:
      1
      Number change:
      2
      Number change:
      3
      .....

      But if repeatCount is set to 5, it would print:
      Number change:
      0
      Number change:
      21
      Number change:
      22
      Number change:
      23
      Number change:
      24
      Number change:
      25
      Number change:
      26
      Number change:
      25
      Number change:
      24
      Number change:
      23
      ...

            loneid Leonid Popov (Inactive)
            kbouyoucsunw Karim Bouyoucef (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: