oops - bug in setChildPositions leading to recursion
authorClaus Gittinger <cg@exept.de>
Fri, 08 Oct 1999 12:20:51 +0200
changeset 2030 30247cb8fab0
parent 2029 22629607c6eb
child 2031 6f28b9951713
oops - bug in setChildPositions leading to recursion
HorizontalPanelView.st
--- a/HorizontalPanelView.st	Thu Oct 07 13:23:14 1999 +0200
+++ b/HorizontalPanelView.st	Fri Oct 08 12:20:51 1999 +0200
@@ -1153,14 +1153,6 @@
         ] ifFalse:[
             l := hL.
 
-            "/ adjust - do not include width of last(first) element if doing a fit
-            (hL == #leftFit or:[hL == #leftSpaceFit]) ifTrue:[
-                subViews last width:0.
-            ].
-            (hL == #rightFit or:[hL == #rightSpaceFit]) ifTrue:[
-                subViews first width:0.
-            ].
-
             "
              compute net width needed
             "
@@ -1168,6 +1160,15 @@
                 sumOfWidths := subViews inject:0 into:[:sumSoFar :child | sumSoFar + maxWidth + (child borderWidth*2)].
             ] ifFalse:[
                 sumOfWidths := subViews inject:0 into:[:sumSoFar :child | sumSoFar + child widthIncludingBorder].
+
+                "/ adjust - do not include width of last(first) element if doing a fit
+                (hL == #leftFit or:[hL == #leftSpaceFit]) ifTrue:[
+                    sumOfWidths := sumOfWidths - subViews last widthIncludingBorder.
+                ] ifFalse:[
+                    (hL == #rightFit or:[hL == #rightSpaceFit]) ifTrue:[
+                        sumOfWidths := sumOfWidths - subViews first widthIncludingBorder.
+                    ]
+                ].
             ].
 
             restWidth := width - sumOfWidths.
@@ -1464,5 +1465,5 @@
 !HorizontalPanelView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.38 1999-09-09 17:03:04 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/HorizontalPanelView.st,v 1.39 1999-10-08 10:20:51 cg Exp $'
 ! !