RFR: 8332895: Support interpolation for backgrounds and borders [v36]

Michael Strauß mstrauss at openjdk.org
Sat Sep 14 07:05:59 UTC 2024


On Sat, 14 Sep 2024 04:36:09 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   small doc changes, copyright header
>
> modules/javafx.graphics/src/main/java/javafx/scene/layout/Background.java line 292:
> 
>> 290:     private Background(List<BackgroundFill> fills, List<BackgroundImage> images, int ignored) {
>> 291:         Objects.requireNonNull(fills, "fills cannot be null");
>> 292:         Objects.requireNonNull(images, "images cannot be null");
> 
> Are these reached if there is an interpolation from/to null with a non-null?

Interpolation with `null` is not possible: `Interpolatable.interpolate(T, double)` is specified to throw NPE when `null` is passed in. When a styleable property transitions from a null value to a non-null value, it always transitions as discrete (i.e. is switches at the 50% mark) and doesn't use `Interpolatable.interpolate`.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1522#discussion_r1759683672


More information about the openjfx-dev mailing list