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

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

Issue 1219113003: Make popup menus line up to their baseline per the Material spec. (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
« no previous file with comments | « sky/sdk/lib/rendering/box.dart ('k') | sky/sdk/lib/rendering/object.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 6
7 import 'box.dart'; 7 import 'box.dart';
8 import 'object.dart'; 8 import 'object.dart';
9 9
10 class FlexBoxParentData extends BoxParentData with ContainerParentDataMixin<Rend erBox> { 10 class FlexBoxParentData extends BoxParentData with ContainerParentDataMixin<Rend erBox> {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 ); 239 );
240 } 240 }
241 241
242 double getMaxIntrinsicHeight(BoxConstraints constraints) { 242 double getMaxIntrinsicHeight(BoxConstraints constraints) {
243 return _getIntrinsicSize( 243 return _getIntrinsicSize(
244 constraints: constraints, 244 constraints: constraints,
245 sizingDirection: FlexDirection.vertical, 245 sizingDirection: FlexDirection.vertical,
246 childSize: (c, innerConstraints) => c.getMaxIntrinsicHeight(innerConstrain ts)); 246 childSize: (c, innerConstraints) => c.getMaxIntrinsicHeight(innerConstrain ts));
247 } 247 }
248 248
249 double getDistanceToActualBaseline(TextBaseline baseline) { 249 double computeDistanceToActualBaseline(TextBaseline baseline) {
250 assert(!needsLayout);
251 if (_direction == FlexDirection.horizontal) 250 if (_direction == FlexDirection.horizontal)
252 return defaultGetDistanceToHighestActualBaseline(baseline); 251 return defaultComputeDistanceToHighestActualBaseline(baseline);
253 return defaultGetDistanceToFirstActualBaseline(baseline); 252 return defaultComputeDistanceToFirstActualBaseline(baseline);
254 } 253 }
255 254
256 int _getFlex(RenderBox child) { 255 int _getFlex(RenderBox child) {
257 assert(child.parentData is FlexBoxParentData); 256 assert(child.parentData is FlexBoxParentData);
258 return child.parentData.flex != null ? child.parentData.flex : 0; 257 return child.parentData.flex != null ? child.parentData.flex : 0;
259 } 258 }
260 259
261 double _getCrossSize(RenderBox child) { 260 double _getCrossSize(RenderBox child) {
262 return (_direction == FlexDirection.horizontal) ? child.size.height : child. size.width; 261 return (_direction == FlexDirection.horizontal) ? child.size.height : child. size.width;
263 } 262 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 } 390 }
392 391
393 void hitTestChildren(HitTestResult result, { Point position }) { 392 void hitTestChildren(HitTestResult result, { Point position }) {
394 defaultHitTestChildren(result, position: position); 393 defaultHitTestChildren(result, position: position);
395 } 394 }
396 395
397 void paint(PaintingCanvas canvas, Offset offset) { 396 void paint(PaintingCanvas canvas, Offset offset) {
398 defaultPaint(canvas, offset); 397 defaultPaint(canvas, offset);
399 } 398 }
400 } 399 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/rendering/box.dart ('k') | sky/sdk/lib/rendering/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698