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

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

Issue 1147143005: Make Drawer in components2 work (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase 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/framework/fn2.dart ('k') | sky/sdk/lib/framework/rendering/stack.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 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 import 'node.dart'; 8 import 'node.dart';
9 import 'package:vector_math/vector_math.dart'; 9 import 'package:vector_math/vector_math.dart';
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 this.maxWidth: double.INFINITY, 43 this.maxWidth: double.INFINITY,
44 this.minHeight: 0.0, 44 this.minHeight: 0.0,
45 this.maxHeight: double.INFINITY}); 45 this.maxHeight: double.INFINITY});
46 46
47 BoxConstraints.tight(sky.Size size) 47 BoxConstraints.tight(sky.Size size)
48 : minWidth = size.width, 48 : minWidth = size.width,
49 maxWidth = size.width, 49 maxWidth = size.width,
50 minHeight = size.height, 50 minHeight = size.height,
51 maxHeight = size.height; 51 maxHeight = size.height;
52 52
53 BoxConstraints.loose(sky.Size size)
54 : minWidth = 0.0,
55 maxWidth = size.width,
56 minHeight = 0.0,
57 maxHeight = size.height;
58
53 BoxConstraints deflate(EdgeDims edges) { 59 BoxConstraints deflate(EdgeDims edges) {
54 assert(edges != null); 60 assert(edges != null);
55 double horizontal = edges.left + edges.right; 61 double horizontal = edges.left + edges.right;
56 double vertical = edges.top + edges.bottom; 62 double vertical = edges.top + edges.bottom;
57 return new BoxConstraints( 63 return new BoxConstraints(
58 minWidth: math.max(0.0, minWidth - horizontal), 64 minWidth: math.max(0.0, minWidth - horizontal),
59 maxWidth: maxWidth - horizontal, 65 maxWidth: maxWidth - horizontal,
60 minHeight: math.max(0.0, minHeight - vertical), 66 minHeight: math.max(0.0, minHeight - vertical),
61 maxHeight: maxHeight - vertical 67 maxHeight: maxHeight - vertical
62 ); 68 );
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 Vector3 transformed3 = inverse.transform3(position3); 346 Vector3 transformed3 = inverse.transform3(position3);
341 sky.Point transformed = new sky.Point(transformed3.x, transformed3.y); 347 sky.Point transformed = new sky.Point(transformed3.x, transformed3.y);
342 super.hitTestChildren(result, position: transformed); 348 super.hitTestChildren(result, position: transformed);
343 } 349 }
344 350
345 void paint(RenderNodeDisplayList canvas) { 351 void paint(RenderNodeDisplayList canvas) {
346 Float32List storage = _transform.storage; 352 Float32List storage = _transform.storage;
347 353
348 canvas.save(); 354 canvas.save();
349 canvas.concat([ 355 canvas.concat([
350 storage[ 0], storage[ 1], storage[ 3], 356 storage[ 0], storage[ 4], storage[12],
351 storage[ 4], storage[ 5], storage[ 7], 357 storage[ 1], storage[ 5], storage[13],
352 storage[12], storage[13], storage[15], 358 storage[ 3], storage[ 7], storage[15],
353 ]); 359 ]);
354 super.paint(canvas); 360 super.paint(canvas);
355 canvas.restore(); 361 canvas.restore();
356 } 362 }
357 } 363 }
358 364
359 365
360 // RENDER VIEW LAYOUT MANAGER 366 // RENDER VIEW LAYOUT MANAGER
361 367
362 class ViewConstraints { 368 class ViewConstraints {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 463
458 void defaultPaint(RenderNodeDisplayList canvas) { 464 void defaultPaint(RenderNodeDisplayList canvas) {
459 RenderBox child = firstChild; 465 RenderBox child = firstChild;
460 while (child != null) { 466 while (child != null) {
461 assert(child.parentData is ParentDataType); 467 assert(child.parentData is ParentDataType);
462 canvas.paintChild(child, child.parentData.position); 468 canvas.paintChild(child, child.parentData.position);
463 child = child.parentData.nextSibling; 469 child = child.parentData.nextSibling;
464 } 470 }
465 } 471 }
466 } 472 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/fn2.dart ('k') | sky/sdk/lib/framework/rendering/stack.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698