90 degree rotating mark takes up unnecessary horizontal space

This question is based on the Javafx rotate Label issue , but since this post is outdated and does not have a satisfactory answer, I would like to mention it again.

The problem is this:

When you rotate the label 90 or 270 degrees, firstly, the text is truncated, because it has a minimum minimum width. When I set the minimum width, the text no longer truncates.

However, the minimum width is also set in the horizontal direction, as shown below:

Label issue with minimum width

The situation is on the left, as it is now, in Java 8u40, and on the right, as I like (and this is the most logical way, in my opinion).

I just used this code:

Label label = new Label("This is a label."); label.setRotate(270); label.setMinWidth(200); 

I added a shortcut to AnchorPane , which is not part of issue I, except. I also tried the @James_D workaround ( https://community.oracle.com/thread/3514254 ), which didn't work for me either.

So my question is:

This is a known mistake, and if so: is there a chance that it will be fixed in the future? Also, is there another workaround (besides placing a label on the image)?

+4
source share
1 answer

In my opinion, this is a mistake. I ran a test with a JavaFX application with spinning text on Windows (using Oracle JavaFX, JDK1.8.0.60j, and then moved it to a Raspberry Pi. Open JavaFX was launched on Pi. On JavaFX, rotation runs correctly and Oracle JavaFX shows the behavior which you described here.

0
source

Source: https://habr.com/ru/post/1484439/


All Articles