chart-fx
chart-fx copied to clipboard
Desktop scaling is not respected
Describe the bug
When desktop scaling is not 100% things start to behave unexpectedly. For example, SquareButton starts forcing ToolBar height to grow on each pulse of layout rendering. Another example is DefaultNumericAxis.getDisplayPosition which fails de.gsi.chart.plugins.DataPointTooltipTest due to wrong coordinates to move the desktop pointer to.
To Reproduce
In the wild: scale up the desktop icons to say 125% then run de.gsi.chart.samples.DataViewerSample and click on "the thermometer" - the toolbar will start to grow indefinitely
In the tests: add the following lines to the end of de.gsi.chart.plugins.DataPointTooltipTest.start method and run the test
scene.getWindow().setRenderScaleY(1.25);
scene.getWindow().setRenderScaleX(1.25);
Environment:
- OS: Windows 7
- Java version: temurin-11.0.16
- JavaFx version: 13
- ChartFx version: 11.2.7
I have a simple solution for SquareButton but it seems to be just a tip of an iceberg.
That's interesting, until now I didn't have any HiDPI setup where this would cause problems, but of course this nowadays is a pretty standard thing which has to be supported. I'll have to look into how this is generally handled in javafx.
Thanks for sharing your findings and providing a way to test this. Please feel free to open a (draft - if you think it is not ready to be merged) PR for your SquareButton solution even though I fear that you are correct in your iceberg assesment.
Please feel free to open a (draft - if you think it is not ready to be merged) PR
here it is: #541
I'll have to look into how this is generally handled in javafx
I could share some of my understanding if you'd like