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

Side by Side Diff: sky/sdk/lib/framework/layout2.dart

Issue 1146123003: Move simple_render_tree into tests as render_flex (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: now with expected.txt 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/examples/raw/simple_render_tree.dart ('k') | sky/tests/raw/render_flex.dart » ('j') | 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 'node.dart'; 5 import 'node.dart';
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 7
8 // ABSTRACT LAYOUT 8 // ABSTRACT LAYOUT
9 9
10 class ParentData { 10 class ParentData {
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 assert(child.parentData is BlockParentData); 818 assert(child.parentData is BlockParentData);
819 child = child.parentData.nextSibling; 819 child = child.parentData.nextSibling;
820 } 820 }
821 821
822 return new BoxDimensions(width: outerWidth, 822 return new BoxDimensions(width: outerWidth,
823 height: constraints.constrainHeight(outerHeight)); 823 height: constraints.constrainHeight(outerHeight));
824 } 824 }
825 825
826 void performLayout() { 826 void performLayout() {
827 assert(constraints is BoxConstraints); 827 assert(constraints is BoxConstraints);
828 size.width = constraints.constrainWidth(constraints.maxWidth); 828 double width = constraints.constrainWidth(constraints.maxWidth);
829 assert(size.width < double.INFINITY);
830 double y = 0.0; 829 double y = 0.0;
831 double innerWidth = size.width;
832 RenderBox child = firstChild; 830 RenderBox child = firstChild;
833 while (child != null) { 831 while (child != null) {
834 child.layout(new BoxConstraints(minWidth: innerWidth, maxWidth: innerWidth ), parentUsesSize: true); 832 child.layout(new BoxConstraints(minWidth: width, maxWidth: width), parentU sesSize: true);
835 assert(child.parentData is BlockParentData); 833 assert(child.parentData is BlockParentData);
836 child.parentData.position = new sky.Point(0.0, y); 834 child.parentData.position = new sky.Point(0.0, y);
837 y += child.size.height; 835 y += child.size.height;
838 child = child.parentData.nextSibling; 836 child = child.parentData.nextSibling;
839 } 837 }
840 size.height = constraints.constrainHeight(y); 838 size = new sky.Size(width, constraints.constrainHeight(y));
839 assert(size.width < double.INFINITY);
840 assert(size.height < double.INFINITY);
841 } 841 }
842 842
843 void hitTestChildren(HitTestResult result, { sky.Point position }) { 843 void hitTestChildren(HitTestResult result, { sky.Point position }) {
844 defaultHitTestChildren(result, position: position); 844 defaultHitTestChildren(result, position: position);
845 } 845 }
846 846
847 void paint(RenderNodeDisplayList canvas) { 847 void paint(RenderNodeDisplayList canvas) {
848 super.paint(canvas); 848 super.paint(canvas);
849 defaultPaint(canvas); 849 defaultPaint(canvas);
850 } 850 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 990
991 void hitTestChildren(HitTestResult result, { double x, double y }) { 991 void hitTestChildren(HitTestResult result, { double x, double y }) {
992 // defaultHitTestChildren(result, x: x, y: y); 992 // defaultHitTestChildren(result, x: x, y: y);
993 } 993 }
994 994
995 void paint(RenderNodeDisplayList canvas) { 995 void paint(RenderNodeDisplayList canvas) {
996 super.paint(canvas); 996 super.paint(canvas);
997 _layoutRoot.paint(canvas); 997 _layoutRoot.paint(canvas);
998 } 998 }
999 } 999 }
OLDNEW
« no previous file with comments | « sky/examples/raw/simple_render_tree.dart ('k') | sky/tests/raw/render_flex.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698