changeset 3770:804a55322e91

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/scrum/graphics/jfx/rt
author Martin Sladecek <martin.sladecek@oracle.com>
date Thu, 30 May 2013 15:43:59 +0200
parents b29ce522d568 f2583a30a508
children c48aba5f8936
files
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/javafx/scene/layout/HBox.java	Thu May 30 07:39:26 2013 -0400
+++ b/javafx-ui-common/src/javafx/scene/layout/HBox.java	Thu May 30 15:43:59 2013 +0200
@@ -498,18 +498,18 @@
             }
         } else {
             for (int i = 0, size = managed.size(); i < size; i++) {
-            final Node child = managed.get(i);
-            if (getHgrow(child) == priority) {
-                temp[i] = computeChildMaxAreaWidth(child, getMargin(child), height);
-                adjustingNumber++;
-            } else {
-                temp[i] = -1;
+                final Node child = managed.get(i);
+                if (getHgrow(child) == priority) {
+                    temp[i] = computeChildMaxAreaWidth(child, getMargin(child), height);
+                    adjustingNumber++;
+                } else {
+                    temp[i] = -1;
+                }
             }
         }
-        }
 
         double available = extraWidth; // will be negative in shrinking case
-        while (Math.abs(available) > 1 && adjustingNumber > 0) {
+        outer:while (Math.abs(available) > 1 && adjustingNumber > 0) {
             final double portion = snapPortion(available / adjustingNumber); // negative in shrinking case
             for (int i = 0, size = managed.size(); i < size; i++) {
                 if (temp[i] == -1) {
@@ -519,8 +519,8 @@
                 final double change = Math.abs(limit) <= Math.abs(portion)? limit : portion;
                 usedWidths[i] += change;
                 available -= change;
-                if (available == 0) {
-                    break;
+                if (Math.abs(available) < 1) {
+                    break outer;
                 }
                 if (Math.abs(change) < Math.abs(portion)) {
                     temp[i] = -1;