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

Unified Diff: sky/examples/raw/sector-layout.dart

Issue 1156303004: Use Point, Size, and Rect in layout2.dart (Closed) Base URL: git@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
Index: sky/examples/raw/sector-layout.dart
diff --git a/sky/examples/raw/sector-layout.dart b/sky/examples/raw/sector-layout.dart
index 3b6d388edf96a9d4819d3d89489904e424d960de..2e7483996e30bc6c4b31bd245a5ed103db837f4a 100644
--- a/sky/examples/raw/sector-layout.dart
+++ b/sky/examples/raw/sector-layout.dart
@@ -264,7 +264,7 @@ class RenderSectorRing extends RenderSectorWithChildren {
RenderSector child = firstChild;
while (child != null) {
assert(child.parentData is SectorChildListParentData);
- canvas.paintChild(child, 0.0, 0.0);
+ canvas.paintChild(child, new sky.Point());
Hixie 2015/05/28 18:45:22 I don't like the way this looks. It's not obvious
child = child.parentData.nextSibling;
}
}
@@ -384,7 +384,7 @@ class RenderSectorSlice extends RenderSectorWithChildren {
RenderSector child = firstChild;
while (child != null) {
assert(child.parentData is SectorChildListParentData);
- canvas.paintChild(child, 0.0, 0.0);
+ canvas.paintChild(child, new sky.Point());
child = child.parentData.nextSibling;
}
}
@@ -463,10 +463,12 @@ class RenderBoxToRenderSectorAdapter extends RenderBox {
void paint(RenderNodeDisplayList canvas) {
super.paint(canvas);
if (child != null)
- canvas.paintChild(child, width/2.0, height/2.0);
+ canvas.paintChild(child, new sky.Point(width/2.0, height/2.0));
Hixie 2015/05/28 18:45:22 We could replace width/height with a Rect and then
}
- bool hitTest(HitTestResult result, { double x, double y }) {
+ bool hitTest(HitTestResult result, { sky.Point position }) {
+ double x = position.x;
+ double y = position.y;
if (child == null)
return false;
// translate to our origin

Powered by Google App Engine
This is Rietveld 408576698