Permalink
Browse files

fix hasPushX and hasPushY assign in Grid

in original:
```java
hasPushX |= (visible || hideMode > 1) && (cc.getPushX() != null);
hasPushY |= (visible || hideMode > 1) && (cc.getPushY() != null);
```
  • Loading branch information...
1 parent db96a56 commit 4ca43cff7a05812cc0140c0a9020c403b77b52f8 @kutu committed Oct 3, 2012
Showing with 6 additions and 6 deletions.
  1. +4 −4 core/src/net/miginfocom/layout/CC.as
  2. +2 −2 core/src/net/miginfocom/layout/Grid.as
@@ -441,7 +441,7 @@ public final class CC {
* will take precedence. Push is normally used when the grid has not been defined in the layout.
* <p>
* If multiple components in a column has push weights set the largest one will be used for the column.
- * @return The current push value. Default is <code>null</code>.
+ * @return The current push value. Default is <code>NaN</code>.
*/
public function get pushX():Number {
return _pushX;
@@ -452,7 +452,7 @@ public final class CC {
* will take precedence. Push is normally used when the grid has not been defined in the layout.
* <p>
* If multiple components in a column has push weights set the largest one will be used for the column.
- * @param weight The new push value. Default is <code>null</code>.
+ * @param weight The new push value. Default is <code>NaN</code>.
*/
public function set pushX(weight:Number):void {
_pushX = weight;
@@ -463,7 +463,7 @@ public final class CC {
* will take precedence. Push is normally used when the grid has not been defined in the layout.
* <p>
* If multiple components in a row has push weights set the largest one will be used for the row.
- * @return The current push value. Default is <code>null</code>.
+ * @return The current push value. Default is <code>NaN</code>.
*/
public function get pushY():Number {
return _pushY;
@@ -474,7 +474,7 @@ public final class CC {
* will take precedence. Push is normally used when the grid has not been defined in the layout.
* <p>
* If multiple components in a row has push weights set the largest one will be used for the row.
- * @param value The new push value. Default is <code>null</code>.
+ * @param value The new push value. Default is <code>NaN</code>.
*/
public function set pushY(value:Number):void {
_pushY = value;
@@ -271,8 +271,8 @@ public final class Grid {
continue; // To work with situations where there are components that does not have a layout manager, or not this one.
}
- hasPushX ||= (visible || hideMode > 1) && cc.pushX == cc.pushX;
- hasPushY ||= (visible || hideMode > 1) && cc.pushY == cc.pushY;
+ hasPushX ||= (visible || hideMode > 1) && !isNaN(cc.pushX);
+ hasPushY ||= (visible || hideMode > 1) && !isNaN(cc.pushY);
if (cc != rootCc) { // If not first in a cell
if (cc.newline || !cc.boundsInGrid || cc.dockSide != -1) {

0 comments on commit 4ca43cf

Please sign in to comment.