Chromium Code Reviews| Index: sky/sdk/lib/framework/rendering/box.dart |
| diff --git a/sky/sdk/lib/framework/rendering/box.dart b/sky/sdk/lib/framework/rendering/box.dart |
| index cfa83a7cac4506c6546e6a02c09d0b6db3e455bf..f2b33fe86fe76457f15849ee758e171ce782aa57 100644 |
| --- a/sky/sdk/lib/framework/rendering/box.dart |
| +++ b/sky/sdk/lib/framework/rendering/box.dart |
| @@ -36,6 +36,16 @@ class EdgeDims { |
| (right == other.right) || |
| (bottom == other.bottom) || |
| (left == other.left); |
| + |
| + int get hashCode { |
| + value = 373; |
| + value = 37 * value + top.hashCode; |
|
eseidel
2015/06/03 23:23:16
Why the magic number? And doesn't dart have a *=?
|
| + value = 37 * value + left.hashCode; |
| + value = 37 * value + bottom.hashCode; |
| + value = 37 * value + right.hashCode; |
| + return value; |
| + } |
| + String toString() => "EdgeDims($top, $right, $bottom, $left)"; |
| } |
| class BoxConstraints { |
| @@ -87,6 +97,16 @@ class BoxConstraints { |
| } |
| bool get isInfinite => maxWidth >= double.INFINITY || maxHeight >= double.INFINITY; |
| + |
| + int get hashCode { |
| + value = 373; |
| + value = 37 * value + minWidth.hashCode; |
|
eseidel
2015/06/03 23:23:16
Maybe we want a hash() helper which can take N num
|
| + value = 37 * value + maxWidth.hashCode; |
| + value = 37 * value + minHeight.hashCode; |
| + value = 37 * value + maxHeight.hashCode; |
| + return value; |
| + } |
| + String toString() => "BoxConstraints($minWidth<=w<$maxWidth, $minHeight<=h<$maxHeight)"; |
| } |
| class BoxParentData extends ParentData { |