Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: sky/sdk/lib/framework/rendering/box.dart

Issue 1166523006: Make EdgeDims and BoxConstraints printable (for debugging) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698