RFR: 8314754: Minor ticks are not getting updated both the axes in LineChart [v2]
Marius Hanl
mhanl at openjdk.org
Tue Jun 25 22:51:13 UTC 2024
On Tue, 25 Jun 2024 21:46:25 GMT, Markus Mack <mmack at openjdk.org> wrote:
>> This PR ensures the `tickMarksUpdated()` method (overriden with minor tick mark layout code in subclasses) is called during `Chart` `Axis` layout when needed.
>> Previously, it was only called when tick mark length or range was changed, which is not happening during axis animations, causing minor ticks to become outdated when animations are enabled.
>>
>> I've added a test that fails with the previous code, specifically checking the tick mark spacing.
>> Alternatively the test could be implemented by accessing ValueAxis.minorTickMarkValues, which would need to be made at least package-private however (with a shim). This implementation checks the tick mark `Path` shape instead, which is already publicly accessible (but could be considered an implementation detail).
>
> Markus Mack has updated the pull request incrementally with two additional commits since the last revision:
>
> - cleanup imports
> - add clarifying comment to test
Left one comment, looks good to me otherwise as well!
modules/javafx.controls/src/test/java/test/javafx/scene/chart/XYNumberLineChartsTest.java line 30:
> 28: import javafx.scene.shape.MoveTo;
> 29: import javafx.scene.shape.Path;
> 30: import org.junit.jupiter.api.Assertions;
Note: This mixes JUnit 4 with JUnit 5 API.
AFAIK, this is nothing we want, so it is better to use the already imported `assertEquals` (from JUnit 4) below.
-------------
PR Review: https://git.openjdk.org/jfx/pull/1489#pullrequestreview-2140011083
PR Review Comment: https://git.openjdk.org/jfx/pull/1489#discussion_r1653662369
More information about the openjfx-dev
mailing list