changeset 6213:b4bba0235d0e

RT-35506: [TextFlow] TextFlow.computePrefHeight(double width) with width > Float.MAX_VALUE leads to erroneous behavior.
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Thu, 30 Jan 2014 08:31:16 -0800
parents 49989b07fd2c
children 10862f205869
files modules/graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java	Thu Jan 30 18:31:01 2014 +0200
+++ b/modules/graphics/src/main/java/com/sun/javafx/text/PrismTextLayout.java	Thu Jan 30 08:31:16 2014 -0800
@@ -181,6 +181,8 @@
     }
 
     public boolean setWrapWidth(float newWidth) {
+        if (Float.isFinite(newWidth)) newWidth = 0;
+        if (Float.isNaN(newWidth)) newWidth = 0;
         float oldWidth = this.wrapWidth;
         this.wrapWidth = Math.max(0, newWidth);