Moved from bug # 6694107
Text node has negative bounds by default and brokes the behavior of VBox node.
It is inconvenient to draw the text over the rectangle.
Consider attached test case (with picture).
1.
Group {content: [
Rectangle {width: 350 height: 100 stroke: fill},
Text {content: "JavaFX" font: font fill: fill},
]}
EXPECTED: the text over the rectangle
ACTUAL: the text above the rectangle
2.
Group {content: [
Rectangle {width: 100 height: 100 fill: fill},
Text {content: "language" font: font fill: fill},
Rectangle {width: 100 height: 100 fill: fill},
]}
EXPECTED: the text between the squares
ACTUAL: the text between the squares, but above then squares.
Note, VBox and HBox layout does not support negative bounds.
Whole circle should be visible.
Text from the last group should not be over the previous group.
--------------Submitted by sergey.malenkov [2008-04-25 13:47]
I think that height of the Text node should be the font height.
It helps to align different Text nodes using HBox...
--------------Comments from sergey.malenkov [2008-04-25 14:09]
Text node has negative bounds by default and brokes the behavior of VBox node.
It is inconvenient to draw the text over the rectangle.
Consider attached test case (with picture).
1.
Group {content: [
Rectangle {width: 350 height: 100 stroke: fill},
Text {content: "JavaFX" font: font fill: fill},
]}
EXPECTED: the text over the rectangle
ACTUAL: the text above the rectangle
2.
Group {content: [
Rectangle {width: 100 height: 100 fill: fill},
Text {content: "language" font: font fill: fill},
Rectangle {width: 100 height: 100 fill: fill},
]}
EXPECTED: the text between the squares
ACTUAL: the text between the squares, but above then squares.
Note, VBox and HBox layout does not support negative bounds.
Whole circle should be visible.
Text from the last group should not be over the previous group.
--------------Submitted by sergey.malenkov [2008-04-25 13:47]
I think that height of the Text node should be the font height.
It helps to align different Text nodes using HBox...
--------------Comments from sergey.malenkov [2008-04-25 14:09]
- relates to
-
JDK-8104743 Text returns unexpected size in CustomNode
-
- Closed
-