changeset 6917:52f27b865f51

[TextFlow] TextFlow has to handle BASELINE_OFFSET_SAME_AS_HEIGHT properly
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Wed, 30 Apr 2014 13:23:23 -0700
parents b6812eeecbc9
children d71ed34d7bd5
files modules/graphics/src/main/java/javafx/scene/text/TextFlow.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/scene/text/TextFlow.java	Wed Apr 30 06:22:16 2014 -0700
+++ b/modules/graphics/src/main/java/javafx/scene/text/TextFlow.java	Wed Apr 30 13:23:23 2014 -0700
@@ -344,6 +344,9 @@
                      * to run a full text analysis in the new content.
                      */
                     double baseline = node.getBaselineOffset();
+                    if (baseline == BASELINE_OFFSET_SAME_AS_HEIGHT) {
+                        baseline = node.getLayoutBounds().getHeight();
+                    }
                     double width = computeChildPrefAreaWidth(node, null);
                     double height = computeChildPrefAreaHeight(node, null);
                     spans[i] = new EmbeddedSpan(node, baseline, width, height);