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

Transform.affine() passes arguments to java.awt.geom.AffineTransform incorrectly.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx1.2
    • None
    • javafx
    • Using NetBeans 6.5 /w javafx plugin


      From the documentation page:

      [m00x + m01y + m02] = x'
      [m10x + m11y + m12] = y'

      So if I want to map (x,y) -> (x,y), the identity transform, I want
      m00 == m11 = 1
      and
      m01 == m02 == m10 == m12 = 0.

      public affine(m00: Number, m01: Number, m02: Number, m10: Number, m11: Number, m12: Number) : Affine

      Therefore, the call should be

      affine(1,0,0,0,1,0) But, this causes the shape to disappear!

      FX.println(Transform.affine(1,0,0,0,1,0).impl_getAffineTransform());

      prints

      AffineTransform[[1.0, 0.0, 1.0], [0.0, 0.0, 0.0]]

      It seems the java implementation object is getting its arguments passed in the wrong order (column-first instead of row first) when it is created by its javafx peer.

      FX.println(Transform.affine(1,2,3,4,5,6).impl_getAffineTransform());

      we expect

      AffineTransform[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]

      but instead, get

      AffineTransform[[1.0, 3.0, 5.0], [2.0, 4.0, 6.0]].

      The correct function documentation corresponding to the actual current implementation is

      public affine(m00: Number, m10: Number, m01: Number, m11: Number, m02: Number, m12: Number) : Affine

      affine(1,0,0,1,0,0) gives the identity transform, as expected.

            ckyang Chien Yang (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: