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

Gradients don't translate correctly w/ JDK6u12

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2
    • fx1.3
    • fx1.1
    • javafx

    Description

      The code below demonstrates a bug with translation of gradient paints. The pattern on the box should remain constant, but instead it "moves off" as the box moves across the screen. (The animation in the test case was written to accentuate this).

      I first thought this was a driver issue w/ my video card (7600 GT, notorious for having problems w/ many things), but I also reproduced this on a Radeon X600. It worked okay on the X600 up until I updated my JDK to 6u12.

      This is reproducible with JavaFX 1.1, as well as with marina/scrum/graphics #112.
      ----
      import javafx.animation.Interpolator;
      import javafx.animation.KeyFrame;
      import javafx.animation.Timeline;
      import javafx.scene.paint.Color;
      import javafx.scene.paint.LinearGradient;
      import javafx.scene.paint.Stop;
      import javafx.scene.Scene;
      import javafx.scene.shape.Rectangle;
      import javafx.stage.Stage;

      /**
       * @author bchristi
       */

      var rect: Rectangle = Rectangle {
          width: 100
          height: 100
          fill: LinearGradient {
              stops: [
                  Stop {
                      offset: 0.1,
                      color: Color.TOMATO
                  },
                  Stop {
                      offset: 0.5,
                      color: Color.ROYALBLUE
                  },
                  Stop {
                      offset: 0.9,
                      color: Color.MISTYROSE
                  }
              ]
          }
      }

      var stage = Stage {
          width: 640
          height: 480
          scene: Scene {
              content: rect
          }
      }

      var tl = Timeline {
          repeatCount: 9999
          autoReverse: true
          keyFrames: [
              KeyFrame {
                  time: 3s
                  values: [
                      rect.translateX => 100 tween Interpolator.EASEIN
                  ]
              },
              KeyFrame {
                  time: 4s
                  values: [
                      rect.translateX => 540 tween Interpolator.EASEOUT
                  ]
              }

          ]
      }

      tl.playFromStart();

      Attachments

        Issue Links

          Activity

            People

              flar Jim Graham
              bchristi Brent Christian
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: