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

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

Issue 1211573003: Fill out some more documentation about building RenderBox subclasses. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
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 'dart:math' as math; 5 import 'dart:math' as math;
6 6
7 import 'box.dart'; 7 import 'box.dart';
8 import 'object.dart'; 8 import 'object.dart';
9 9
10 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render Box> { 10 class StackParentData extends BoxParentData with ContainerParentDataMixin<Render Box> {
(...skipping 17 matching lines...) Expand all
28 bool get isPositioned => top != null || right != null || bottom != null || lef t != null; 28 bool get isPositioned => top != null || right != null || bottom != null || lef t != null;
29 29
30 String toString() => '${super.toString()}; top=$top; right=$right; bottom=$bot tom, left=$left'; 30 String toString() => '${super.toString()}; top=$top; right=$right; bottom=$bot tom, left=$left';
31 } 31 }
32 32
33 class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S tackParentData>, 33 class RenderStack extends RenderBox with ContainerRenderObjectMixin<RenderBox, S tackParentData>,
34 RenderBoxContainerDefaultsMixin<RenderB ox, StackParentData> { 34 RenderBoxContainerDefaultsMixin<RenderB ox, StackParentData> {
35 RenderStack({ 35 RenderStack({
36 List<RenderBox> children 36 List<RenderBox> children
37 }) { 37 }) {
38 if (children != null) 38 addAll(children);
39 children.forEach((child) { add(child); });
40 } 39 }
41 40
42 void setParentData(RenderBox child) { 41 void setParentData(RenderBox child) {
43 if (child.parentData is! StackParentData) 42 if (child.parentData is! StackParentData)
44 child.parentData = new StackParentData(); 43 child.parentData = new StackParentData();
45 } 44 }
46 45
47 46
48 double getMinIntrinsicWidth(BoxConstraints constraints) { 47 double getMinIntrinsicWidth(BoxConstraints constraints) {
49 double width = constraints.minWidth; 48 double width = constraints.minWidth;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 193 }
195 194
196 void hitTestChildren(HitTestResult result, { Point position }) { 195 void hitTestChildren(HitTestResult result, { Point position }) {
197 defaultHitTestChildren(result, position: position); 196 defaultHitTestChildren(result, position: position);
198 } 197 }
199 198
200 void paint(RenderCanvas canvas) { 199 void paint(RenderCanvas canvas) {
201 defaultPaint(canvas); 200 defaultPaint(canvas);
202 } 201 }
203 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698