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

Side by Side Diff: samples/swarm/swarm_ui_lib/layout/ViewLayout.dart

Issue 12605003: Converting Element.client*, offset* and Screen.avail* over to Rects (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « samples/swarm/Views.dart ('k') | samples/swarm/swarm_ui_lib/touch/Scroller.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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of layout; 5 part of layout;
6 6
7 /** The interface that the layout algorithms use to talk to the view. */ 7 /** The interface that the layout algorithms use to talk to the view. */
8 abstract class Positionable { 8 abstract class Positionable {
9 ViewLayout get layout; 9 ViewLayout get layout;
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 } 101 }
102 } 102 }
103 103
104 static bool hasCustomLayout(Positionable view) { 104 static bool hasCustomLayout(Positionable view) {
105 return view.customStyle['display'] == "-dart-grid"; 105 return view.customStyle['display'] == "-dart-grid";
106 } 106 }
107 107
108 CssStyleDeclaration get _style => layoutParams.style; 108 CssStyleDeclaration get _style => layoutParams.style;
109 109
110 void cacheExistingBrowserLayout() { 110 void cacheExistingBrowserLayout() {
111 _offsetWidth = view.node.offsetWidth; 111 _offsetWidth = view.node.offset.width;
112 _offsetHeight = view.node.offsetHeight; 112 _offsetHeight = view.node.offset.height;
113 } 113 }
114 114
115 int get currentWidth { 115 int get currentWidth {
116 return _offsetWidth; 116 return _offsetWidth;
117 } 117 }
118 118
119 int get currentHeight { 119 int get currentHeight {
120 return _offsetHeight; 120 return _offsetHeight;
121 } 121 }
122 122
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 // For an unset max-content size, use the actual size 227 // For an unset max-content size, use the actual size
228 return size; 228 return size;
229 } 229 }
230 if (style.endsWith('%')) { 230 if (style.endsWith('%')) {
231 num percent = double.parse(style.substring(0, style.length - 1)); 231 num percent = double.parse(style.substring(0, style.length - 1));
232 return ((percent / 100) * parentSize).toInt(); 232 return ((percent / 100) * parentSize).toInt();
233 } 233 }
234 return _toPixels(style); 234 return _toPixels(style);
235 } 235 }
236 } 236 }
OLDNEW
« no previous file with comments | « samples/swarm/Views.dart ('k') | samples/swarm/swarm_ui_lib/touch/Scroller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698