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

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

    Details

    • Type: Enhancement
    • Status: In Progress
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: openjfx11, openjfx13
    • Fix Version/s: openjfx15
    • Component/s: javafx
    • Labels:
      None
    • Subcomponent:
    • Understanding:
      Fix Understood

      Description

      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).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: