peakay / miglayout

Automatically exported from code.google.com/p/miglayout
0 stars 0 forks source link

Loading an image into a button moves adjacent text in latest revision of 5.0-SNAPSHOT #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
When I load an Image into a Button's ImageView, the layout sees reason to 
change and move adjacent text down, so that it is no longer aligned with the 
button.

Attached is a sample application that illustrates the problem.
Drop the main class in src/test/java, the image into src/test/resources and run 
the main method.

(Sorry for the weird summary, I had no clue how to summarize this issue.)

Original issue reported on code.google.com by ursreu...@gmail.com on 18 Apr 2014 at 7:00

Attachments:

GoogleCodeExporter commented 8 years ago
This seems to be a bug in JavaFX. But it is normally not exposed in JavaFX 
because you need to explicitly set baseline alignment in JavaFX for some reason 
and people don't see this unless you're skilled in UI.

Baseline is the bottom part of the text, e.g. the bottom of x. However, JavaFX 
seems to mix this up since even a Rectangle reports a baseline (as the height) 
and not the magic number that tells that there's basically no baseline. Someone 
has interpreted baseline as the bottom part of the component and fudged things 
up. I have to compensate for this in the FX2ComponentWrapper.

From 5.0 I added baseline alignment to MigLayout. The toggle button reports 18 
as it's baseline. But if you set an image it reports the bottom part of the 
image instead. This is wrong. It is still the text's baseline that should be 
reported.

To get around it you can set "aligny center" on the Toggle.

Original comment by mikael.g...@gmail.com on 18 Apr 2014 at 9:35

GoogleCodeExporter commented 8 years ago
Thanks for the analysis.
I will report this as a bug against JavaFX 8 once the current revision is in 
Sonatype's SNAPSHOT repository.

Original comment by ursreu...@gmail.com on 18 Apr 2014 at 9:41

GoogleCodeExporter commented 8 years ago
I have just reported both bugs in their JIRA.

Original comment by mikael.g...@gmail.com on 18 Apr 2014 at 9:56

GoogleCodeExporter commented 8 years ago
https://javafx-jira.kenai.com/browse/RT-36728
https://javafx-jira.kenai.com/browse/RT-36729

Original comment by mikael.g...@gmail.com on 18 Apr 2014 at 9:57

GoogleCodeExporter commented 8 years ago
Thanks, I already found them, watched and voted for them.

Original comment by ursreu...@gmail.com on 18 Apr 2014 at 10:00