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

Add pivot properties for scale and rotation in Node, ScaleTransition and RotateTransition

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • jfx11, jfx13
    • javafx
    • None
    • Fix Understood

      Node's rotate and scale properties do not have a way to use a non-central pivot as is allowed in Rotate and Scale transforms. This forces the user to define such a transform and add it to the node's transform list instead of the convenient built-in properties.

      As a consequence, ScaleTransition and RotateTransition, which act directly on Node's properties, can't define a pivot as well. The workaround again is to animate the transforms' properties after they have been added to the transform list.

      Adding these pivot properties to Node and the transitions would be very convenient.

      The pivots can be represented either by a Point3D or a double for each axis (pivotX, pivotY, pivotZ). Points for consideration:
      1. Scale transform uses 3 doubles each for both the scale amount and the pivot. Rotate transform uses 3 doubles for the pivot and a Point3D for the axis. This seems inconsistent.
      2. Using Point3D is more concise.
      3. Using Point3D is less performant (e.g., interpolation on a Point3D creates a lot of these objects).
      4. Controlling only 1 axis is more difficult with Point3D as it does not expose its coordinates as properties.
      5. Using Point3D allows the user to set a null value for the property. This already causes an NPE for rotationAxis (I believe null should be interpreted as the default instead).

            nlisker Nir Lisker
            nlisker Nir Lisker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: