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

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

Issue 1216613004: Initial implementation of SnackBar (Closed) Base URL: git@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 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // Size size = Size.zero; 404 // Size size = Size.zero;
405 // In debug builds, however: 405 // In debug builds, however:
406 Size _size = Size.zero; 406 Size _size = Size.zero;
407 Size get size { 407 Size get size {
408 if (_size is _DebugSize) { 408 if (_size is _DebugSize) {
409 final _DebugSize _size = this._size; // TODO(ianh): Remove this once the a nalyzer is cleverer 409 final _DebugSize _size = this._size; // TODO(ianh): Remove this once the a nalyzer is cleverer
410 assert(_size._owner == this); 410 assert(_size._owner == this);
411 if (RenderObject.debugActiveLayout != null) { 411 if (RenderObject.debugActiveLayout != null) {
412 // we are always allowed to access our own size (for print debugging and asserts if nothing else) 412 // we are always allowed to access our own size (for print debugging and asserts if nothing else)
413 // other than us, the only object that's allowed to read our size is our parent, if they're said they will 413 // other than us, the only object that's allowed to read our size is our parent, if they're said they will
414 // if you hit this assert trying to access a child's size, pass parentUs esSize: true in layout()
414 assert(debugDoingThisResize || debugDoingThisLayout || 415 assert(debugDoingThisResize || debugDoingThisLayout ||
415 (RenderObject.debugActiveLayout == parent && _size._canBeUsedByPa rent)); 416 (RenderObject.debugActiveLayout == parent && _size._canBeUsedByPa rent));
416 } 417 }
417 assert(_size == this._size); // TODO(ianh): Remove this once the analyzer is cleverer 418 assert(_size == this._size); // TODO(ianh): Remove this once the analyzer is cleverer
418 } 419 }
419 return _size; 420 return _size;
420 } 421 }
421 void set size(Size value) { 422 void set size(Size value) {
422 assert(RenderObject.debugDoingLayout); 423 assert(RenderObject.debugDoingLayout);
423 assert((sizedByParent && debugDoingThisResize) || 424 assert((sizedByParent && debugDoingThisResize) ||
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 1421
1421 void defaultPaint(PaintingCanvas canvas, Offset offset) { 1422 void defaultPaint(PaintingCanvas canvas, Offset offset) {
1422 RenderBox child = firstChild; 1423 RenderBox child = firstChild;
1423 while (child != null) { 1424 while (child != null) {
1424 assert(child.parentData is ParentDataType); 1425 assert(child.parentData is ParentDataType);
1425 canvas.paintChild(child, child.parentData.position + offset); 1426 canvas.paintChild(child, child.parentData.position + offset);
1426 child = child.parentData.nextSibling; 1427 child = child.parentData.nextSibling;
1427 } 1428 }
1428 } 1429 }
1429 } 1430 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698