-
Bug
-
Resolution: Unresolved
-
P4
-
jfx11, 8
-
x86_64
-
generic
A DESCRIPTION OF THE PROBLEM :
Consider a function textHeight which takes a String, a Font and a TextBoundsType and returns the height of a Text element constructed from these parameters by constructing a local Text instance t and returning t.getLayoutBounds().getHeight(). Now fix a String s and a Font f, observe the output of calling:
textHeight(s, f, TextBoundsType.LOGICAL); // A
textHeight(s, f, TextBoundsType.LOGICAL_VERTICAL_CENTER); // B
textHeight(s, f, TextBoundsType.LOGICAL); // C
The result of lines A and C is affected by line B, that is A and C return different results. If you remove B then A and C return the same result (as they clearly should because textHeight is a pure function).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Implement the simple function described above or copy and paste code from this question: https://stackoverflow.com/questions/52424073/strange-javafx-behaviour-related-to-size-of-text-elements?noredirect=1#comment91803770_52424073
FREQUENCY : always
Consider a function textHeight which takes a String, a Font and a TextBoundsType and returns the height of a Text element constructed from these parameters by constructing a local Text instance t and returning t.getLayoutBounds().getHeight(). Now fix a String s and a Font f, observe the output of calling:
textHeight(s, f, TextBoundsType.LOGICAL); // A
textHeight(s, f, TextBoundsType.LOGICAL_VERTICAL_CENTER); // B
textHeight(s, f, TextBoundsType.LOGICAL); // C
The result of lines A and C is affected by line B, that is A and C return different results. If you remove B then A and C return the same result (as they clearly should because textHeight is a pure function).
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Implement the simple function described above or copy and paste code from this question: https://stackoverflow.com/questions/52424073/strange-javafx-behaviour-related-to-size-of-text-elements?noredirect=1#comment91803770_52424073
FREQUENCY : always