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

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

Issue 1165983002: Stub out InkWell and implement Sky’s fn2 menu item (Closed) Base URL: git@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
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 import 'package:sky/framework/net/image_cache.dart' as image_cache; 10 import 'package:sky/framework/net/image_cache.dart' as image_cache;
11 11
12 // GENERIC BOX RENDERING 12 // GENERIC BOX RENDERING
13 // Anything that has a concept of x, y, width, height is going to derive from th is 13 // Anything that has a concept of x, y, width, height is going to derive from th is
14 14
15 class EdgeDims { 15 class EdgeDims {
16 // used for e.g. padding 16 // used for e.g. padding
17 const EdgeDims(this.top, this.right, this.bottom, this.left); 17 const EdgeDims(this.top, this.right, this.bottom, this.left);
18 const EdgeDims.all(double value) 18 const EdgeDims.all(double value)
19 : top = value, right = value, bottom = value, left = value; 19 : top = value, right = value, bottom = value, left = value;
20 20
21 const EdgeDims.onlyLeft(double value) 21 const EdgeDims.onlyLeft(double value)
22 : top = 0.0, right = 0.0, bottom = 0.0, left = value; 22 : top = 0.0, right = 0.0, bottom = 0.0, left = value;
23 const EdgeDims.onlyRight(double value) 23 const EdgeDims.onlyRight(double value)
24 : top = 0.0, right = value, bottom = 0.0, left = 0.0; 24 : top = 0.0, right = value, bottom = 0.0, left = 0.0;
25 const EdgeDims.onlyTop(double value) 25 const EdgeDims.onlyTop(double value)
26 : top = value, right = 0.0, bottom = 0.0, left = 0.0; 26 : top = value, right = 0.0, bottom = 0.0, left = 0.0;
27 const EdgeDims.onlyBottom(double value) 27 const EdgeDims.onlyBottom(double value)
28 : top = 0.0, right = 0.0, bottom = value, left = 0.0; 28 : top = 0.0, right = 0.0, bottom = value, left = 0.0;
29 const EdgeDims.symmetric(double vertical, double horizontal)
Hixie 2015/06/04 17:53:09 Not named?
jackson 2015/06/04 18:03:24 Done.
30 : top = vertical, right = horizontal, bottom = vertical, left = horizontal ;
29 31
30 final double top; 32 final double top;
31 final double right; 33 final double right;
32 final double bottom; 34 final double bottom;
33 final double left; 35 final double left;
34 36
35 operator ==(EdgeDims other) => (top == other.top) || 37 operator ==(EdgeDims other) => (top == other.top) ||
36 (right == other.right) || 38 (right == other.right) ||
37 (bottom == other.bottom) || 39 (bottom == other.bottom) ||
38 (left == other.left); 40 (left == other.left);
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 560
559 void defaultPaint(RenderNodeDisplayList canvas) { 561 void defaultPaint(RenderNodeDisplayList canvas) {
560 RenderBox child = firstChild; 562 RenderBox child = firstChild;
561 while (child != null) { 563 while (child != null) {
562 assert(child.parentData is ParentDataType); 564 assert(child.parentData is ParentDataType);
563 canvas.paintChild(child, child.parentData.position); 565 canvas.paintChild(child, child.parentData.position);
564 child = child.parentData.nextSibling; 566 child = child.parentData.nextSibling;
565 } 567 }
566 } 568 }
567 } 569 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698