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

Side by Side Diff: sky/sdk/lib/framework/rendering/stack.dart

Issue 1166183002: Add Point.origin for new Point(0.0, 0.0) (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « sky/sdk/lib/framework/rendering/box.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'box.dart'; 5 import 'box.dart';
6 import 'object.dart'; 6 import 'object.dart';
7 7
8 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render Box> { } 8 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render Box> { }
9 9
10 class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S tackParentData>, 10 class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S tackParentData>,
(...skipping 13 matching lines...) Expand all
24 Size getIntrinsicDimensions(BoxConstraints constraints) { 24 Size getIntrinsicDimensions(BoxConstraints constraints) {
25 return constraints.constrain(Size.infinite); 25 return constraints.constrain(Size.infinite);
26 } 26 }
27 27
28 void performLayout() { 28 void performLayout() {
29 size = constraints.constrain(Size.infinite); 29 size = constraints.constrain(Size.infinite);
30 assert(size.width < double.INFINITY); 30 assert(size.width < double.INFINITY);
31 assert(size.height < double.INFINITY); 31 assert(size.height < double.INFINITY);
32 BoxConstraints innerConstraints = new BoxConstraints.loose(size); 32 BoxConstraints innerConstraints = new BoxConstraints.loose(size);
33 33
34 Point origin = new Point(0.0, 0.0);
35 RenderBox child = firstChild; 34 RenderBox child = firstChild;
36 while (child != null) { 35 while (child != null) {
37 child.layout(innerConstraints); 36 child.layout(innerConstraints);
38 assert(child.parentData is StackParentData); 37 assert(child.parentData is StackParentData);
39 child.parentData.position = origin; 38 child.parentData.position = Point.origin;
40 child = child.parentData.nextSibling; 39 child = child.parentData.nextSibling;
41 } 40 }
42 } 41 }
43 42
44 void hitTestChildren(HitTestResult result, { Point position }) { 43 void hitTestChildren(HitTestResult result, { Point position }) {
45 defaultHitTestChildren(result, position: position); 44 defaultHitTestChildren(result, position: position);
46 } 45 }
47 46
48 void paint(RenderObjectDisplayList canvas) { 47 void paint(RenderObjectDisplayList canvas) {
49 defaultPaint(canvas); 48 defaultPaint(canvas);
50 } 49 }
51 } 50 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/rendering/box.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698