On Wed, 26 Nov 2025 22:23:12 GMT, Michael Strauß <[email protected]> wrote:
>> modules/javafx.graphics/src/main/java/javafx/animation/Interpolator.java >> line 105: >> >>> 103: * the first or last control point is unspecified, it is set to 0 >>> or 1, respectively. >>> 104: * >>> 105: * @param controlPoints the control points >> >> Do the control points need to be sorted by their X values (excluding NaN)? >> The treatment of NaN values regarding of "neighboring control points" >> suggests that it should be in order for it to be sensible, but perhaps the >> algorithm doesn't require it? > > The answer to this question depends on what you mean by "need to be sorted". > It's certainly possible to specify control points in any order, but the > algorithm won't sort them. Instead, it modifies their input progress values > (X coordinate) such that it never decreases. Here's the relevant part of the > [specification](https://drafts.csswg.org/css-easing/#the-linear-easing-function): > >> If any [control >> point](https://drafts.csswg.org/css-easing/#linear-control-point) has an >> [input progress >> value](https://drafts.csswg.org/css-easing/#easing-function-input-progress-value) >> that is less than the input progress value of any preceding control point, >> set its input progress value to the largest input progress value of any >> preceding control point. Do you think it is worth adding similar language here about what the behavior is if an input progress value is less than any preceding input progress values? ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1977#discussion_r2566652790
