179 |
minLeft = Math.max(myMinLeft, minLeft); |
minLeft = Math.max(myMinLeft, minLeft); |
180 |
minRight = Math.max(myMinRight, minRight); |
minRight = Math.max(myMinRight, minRight); |
181 |
float myPrefLeft = children[i].preferred * children[i].alignment; |
float myPrefLeft = children[i].preferred * children[i].alignment; |
182 |
float myPrefRight = children[i].preferred - myMinLeft; |
float myPrefRight = children[i].preferred - myPrefLeft; |
183 |
prefLeft = Math.max(myPrefLeft, prefLeft); |
prefLeft = Math.max(myPrefLeft, prefLeft); |
184 |
prefRight = Math.max(myPrefRight, prefRight); |
prefRight = Math.max(myPrefRight, prefRight); |
185 |
float myMaxLeft = children[i].maximum * children[i].alignment; |
float myMaxLeft = children[i].maximum * children[i].alignment; |
186 |
float myMaxRight = children[i].maximum - myMinLeft; |
float myMaxRight = children[i].maximum - myMaxLeft; |
187 |
maxLeft = Math.max(myMaxLeft, maxLeft); |
maxLeft = Math.max(myMaxLeft, maxLeft); |
188 |
maxRight = Math.max(myMaxRight, maxRight); |
maxRight = Math.max(myMaxRight, maxRight); |
189 |
} |
} |
190 |
int minSize = (int) (minLeft + minRight); |
int minSize = (int) (minLeft + minRight); |
191 |
int prefSize = (int) (prefLeft + prefRight); |
int prefSize = (int) (prefLeft + prefRight); |
192 |
int maxSize = (int) (maxLeft + maxRight); |
int maxSize = (int) (maxLeft + maxRight); |
193 |
return new SizeRequirements(minSize, prefSize, maxSize, 0.5F); |
float align = prefLeft / (prefRight + prefLeft); |
194 |
|
if (Float.isNaN(align)) |
195 |
|
align = 0; |
196 |
|
return new SizeRequirements(minSize, prefSize, maxSize, align); |
197 |
} |
} |
198 |
|
|
199 |
/** |
/** |