TextFlow and Min vs. Pref size

Danno Ferrin danno.ferrin at shemnon.com
Sun Dec 2 21:20:04 PST 2012


I was playing with the TextFlow bits in the JDK8 ea and was wondering about
the handling of min vs pref sizing.  The TextFlow can return some very
small min sizes which are much smaller than the contained text elements.
For example, I have a text with min/pref/max all of 269.85 x 30.62 while
the min/pref/max of the parent TextFlow (which contains just the text node)
of 0.0 x 17.2 / 269.85 x 48.62 / maxValuexmaxValue.  This is problematic
when place in a scroll pane, as all the text flows tend to bunch up on each
other.

Is this a design intent or an oversight?

For a workaround I've wrapped then TextFlows in panes that report minHeight
as PrefHeight, so I don't see the bunching in scrollpane problem.

For an interactive example of this behavior I have a toy app at bitbucket:
https://bitbucket.org/shemnon/flowdown


More information about the openjfx-dev mailing list