On Sat, 30 Aug 2025 22:07:29 GMT, Michael Strauß <mstra...@openjdk.org> wrote:

>> JavaFX unnecessarily restricts interpolation in the following ways:
>> 1. `Interpolatable` implementations often clamp intermediate values to the 
>> interpolation factor range [0,1].
>> 2. `SplineInterpolator` doesn't accept Y coordinates outside of [0,1] for 
>> its control points. While this was probably done so that the computed 
>> interpolation factor doesn't exceed [0,1], the restriction goes far beyond 
>> that. For example, the following function is not representable, even though 
>> its values are all within the [0,1] range:<br>
>>    <img 
>> src="https://github.com/user-attachments/assets/368b6142-052d-4ead-8a59-cbddf4a19660";
>>  width="400"/><br>
>>    The following function is also not representable, but would be very 
>> useful for [bouncy animations](https://easings.net/#easeOutBack):<br>
>>    <img 
>> src="https://github.com/user-attachments/assets/af02b044-ae4c-4250-b181-72178ad9f3f3";
>>  width="400"/>
>> 
>> Fortunately, there is no technical reason why JavaFX can't support the full 
>> range of animations that can be represented with a cubic Beziér 
>> interpolation function.
>> 
>> This PR includes the following changes:
>> 1. The specification of `Interpolatable` is changed to require 
>> implementations to accept interpolation factors outside of [0,1].
>> 2. All implementations of `Interpolatable` now correctly return intermediate 
>> values outside of [0,1].
>> 3. `SplineInterpolator` now accepts control points with any Y coordinate.
>> 
>> Here's how the result looks like for the previously unrepresentable 
>> interpolation function `cubic-bezier(0.34, 2.2, 0.64, 1)`:<br>
>> <img 
>> src="https://github.com/user-attachments/assets/72c10d0d-71b4-4bb5-b58c-ae377279b0fd";
>>  width="500"/>
>
> Michael Strauß has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   review comments

Looks good except for a typo in the manual test in two of the labels.

I'm running an automated headful test on macOS and Linux now and will approve 
when done (if no failures).

tests/manual/graphics/CssTransitionsTest.java line 121:

> 119:             new RectInfo("#rect4", "rect4", Color.WHITE),
> 120:             new RectInfo("#rect4", "rect5", Color.WHITE),
> 121:             new RectInfo("#rect5", "rect6", Color.WHITE));

Typo in the first string arg in the above two lines: they should be 5 and 6, 
respectively.

-------------

PR Review: https://git.openjdk.org/jfx/pull/1822#pullrequestreview-3189778842
PR Review Comment: https://git.openjdk.org/jfx/pull/1822#discussion_r2325376978

Reply via email to