Replying on the mailing list to the questions raised on GitHub.

The state of whether to use the computed center pivot or the value of the
> pivot attribute is implicit with no way for an application to know which it
> is, and no way to set it back to using the computed center (i.e., the state
> is sticky once you set it). Perhaps if you defined a null value as meaning
> "computed center" then an app could at least reset it to the "computed
> center" state, although there would still be no way for the app to know
> that it was in that state.
>

In the JBS issue <https://bugs.openjdk.java.net/browse/JDK-8234712> I
alluded to this in point 5. I think that null should represent the default
(node center). However, if we use 3 doubles instead of a Point3D we might
need to use Double.NaN for this instead, which would also be the default
for this case. The docs will explain this.

Do we need separate properties for scale pivot and center pivot?
>

I say yes, otherwise the enhancement will be very limited. I think of this
enhancement as adding pivot control to Rotate/Scale transitions, and adding
them to Node is a necessary (and desirable) step.

   ... you need to worry about what coordinate space the rotation pivot is
> defined in. Perhaps if the rotation pivot were defined in unscaled space,
> it might work.
>

Isn't it already? If I set the rotation pivot to the edge of the node, then
scale it down, then rotate, the rotation pivot would be outside of the
node's boundaries. In scaled space it would still be on the edge. Or did I
misunderstand you? In any case, I don't think that there's a single correct
answer here.

Should the pivot be specified as a Point3D or 3 separate doubles? Separate
> doubles... there would be no out-of-band null value to use


See my point above about Double.NaN.
The doubles vs Point3D is an important choice. We might want to look into
the future even where Point3D (and 2D) could be made into an Inline class
with Valhalla, which will help with the performance aspect. Binding to one
of the coordinates is sill a problem there, however.

On Sat, Dec 14, 2019 at 6:25 PM Kevin Rushforth <notificati...@github.com>
wrote:

> This will need discussion on the openjfx-dev mailing list. Here are the
> questions that need to be resolved:
>
>    1.
>
>    The state of whether to use the computed center pivot or the value of
>    the pivot attribute is implicit with no way for an application to know
>    which it is, and no way to set it back to using the computed center (i.e.,
>    the state is sticky once you set it). Perhaps if you defined a null value
>    as meaning "computed center" then an app could at least reset it to the
>    "computed center" state, although there would still be no way for the app
>    to know that it was in that state.
>    2.
>
>    Do we need separate properties for scale pivot and center pivot? A
>    single pivot property would be easier to define, but wouldn't allow you to
>    set it from a RotationTransition and a ScaleTransition if you wanted
>    to apply both to the same Node. With two separate properties, as you
>    have defined it, it is more flexible, but you need to worry about what
>    coordinate space the rotation pivot is defined in. The current transform
>    chain looks like this:
>
> T(layout+translate) * T(pivot) * T(rot) * T(scale) * T(-pivot)
>     * transform[0] * transform [1] ...
>
> Perhaps if the rotation pivot were defined in unscaled space, it might
> work. The transform chain would then look like this:
>
> T(layout+translate) * T(pivotRot/scale) * T(rot) * T(-pivotRot/scale) * 
> T(pivotScale) * T(scale) * T(-pivotScale)
>     * transform[0] * transform [1] ...
>
> In any case, you need to think about the implications of having one of
> scale or rotate being set explicitly and the other being the computed
> center.
>
>    1. Should the pivot be specified as a Point3D or 3 separate doubles? I
>    can see pros / cons of either approach. Separate doubles are more
>    consistent with the the pivot values in the Rotate and Scale Transform
>    objects, and are easier to using in binding. On the other hand, there would
>    be no out-of-band null value to use (see issue 1 above), so you would
>    need a boolean property for each of scale pivot and rotation pivot to
>    indicate whether the computed value or the value of the pivot properties
>    should be used. I don't think that the fact that the rotation axis is
>    defined as a Point3D should have any bearing on whether the pivot
>    should be so defined. I'd probably lean towards separate doubles.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/openjdk/jfx/pull/53?email_source=notifications&email_token=AI5QOM6KRPRRP7VS5OUH6QLQYUCF7A5CNFSM4JR3TYY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4GCGI#issuecomment-565731609>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AI5QOM4UKZQVDEN2A2HYYETQYUCF7ANCNFSM4JR3TYYQ>
> .
>

Reply via email to