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

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

Issue 1205953002: Version 0 of TabLabel, Tab, and TabBar components (Closed) Base URL: https://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/rendering/block.dart ('k') | sky/sdk/lib/widgets/tabs.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 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 7
8 import 'package:vector_math/vector_math.dart'; 8 import 'package:vector_math/vector_math.dart';
9 9
10 import '../base/debug.dart'; 10 import '../base/debug.dart';
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 maxHeight: math.max(maxHeight, newMinHeight)); 156 maxHeight: math.max(maxHeight, newMinHeight));
157 } 157 }
158 158
159 BoxConstraints applyMaxHeight(double newMaxHeight) { 159 BoxConstraints applyMaxHeight(double newMaxHeight) {
160 return new BoxConstraints(minWidth: minWidth, 160 return new BoxConstraints(minWidth: minWidth,
161 maxWidth: maxWidth, 161 maxWidth: maxWidth,
162 minHeight: minHeight, 162 minHeight: minHeight,
163 maxHeight: math.min(maxHeight, newMaxHeight)); 163 maxHeight: math.min(maxHeight, newMaxHeight));
164 } 164 }
165 165
166 BoxConstraints widthConstraints() => new BoxConstraints(minWidth: minWidth, ma xWidth: maxWidth);
167
168 BoxConstraints heightConstraints() => new BoxConstraints(minHeight: minHeight, maxHeight: maxHeight);
169
166 final double minWidth; 170 final double minWidth;
167 final double maxWidth; 171 final double maxWidth;
168 final double minHeight; 172 final double minHeight;
169 final double maxHeight; 173 final double maxHeight;
170 174
171 double constrainWidth(double width) { 175 double constrainWidth(double width) {
172 return clamp(min: minWidth, max: maxWidth, value: width); 176 return clamp(min: minWidth, max: maxWidth, value: width);
173 } 177 }
174 178
175 double constrainHeight(double height) { 179 double constrainHeight(double height) {
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 1231
1228 void defaultPaint(RenderCanvas canvas) { 1232 void defaultPaint(RenderCanvas canvas) {
1229 RenderBox child = firstChild; 1233 RenderBox child = firstChild;
1230 while (child != null) { 1234 while (child != null) {
1231 assert(child.parentData is ParentDataType); 1235 assert(child.parentData is ParentDataType);
1232 canvas.paintChild(child, child.parentData.position); 1236 canvas.paintChild(child, child.parentData.position);
1233 child = child.parentData.nextSibling; 1237 child = child.parentData.nextSibling;
1234 } 1238 }
1235 } 1239 }
1236 } 1240 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/rendering/block.dart ('k') | sky/sdk/lib/widgets/tabs.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698