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

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

Issue 11748016: Make ~/, round, ceil, floor, truncate return ints. Remove toInt. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Checked mode fixes. Created 7 years, 11 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
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 } 222 }
223 } 223 }
224 224
225 static int _styleToPixels(String style, num size, num parentSize) { 225 static int _styleToPixels(String style, num size, num parentSize) {
226 if (style == 'none') { 226 if (style == 'none') {
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).truncate();
233 } 233 }
234 return _toPixels(style); 234 return _toPixels(style);
235 } 235 }
236 } 236 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698