RFR: 8231864: JavaFX Labels in Tab's VBox is not displayed until it is clicked

Kevin Rushforth kcr at openjdk.org
Mon Dec 19 17:17:54 UTC 2022


On Mon, 19 Dec 2022 16:55:14 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Creating a not-displayed node and then modifying its contents caused JFX to not consume its old dirty region and thus not update it. When such node was displayed, its old dirty region was used for drawing, which in some cases (ex. new content taking more space - a Label having more text as in bug request) caused it to clip.
>> 
>> Resolved by always unionizing dirty regions with new bounds when calculating Node's transformed bounds.
>> 
>> Change was tested on macOS and Windows 10 and does not affect any tests.
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/sg/prism/NGNode.java line 338:
> 
>> 336:             dirtyBounds = dirtyBounds.deriveWithUnion(transformedBounds);
>> 337:         }
>> 338:         dirtyBounds = dirtyBounds.deriveWithUnion(bounds);
> 
> Is it possible to create a unit test that fails with unmodified code but passes after the fix?

Given the nature of the failure, an automated test would be difficult at best. Given the simplicity of the fix, testing it manually might be the best approach.

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

PR: https://git.openjdk.org/jfx/pull/978


More information about the openjfx-dev mailing list