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

Side by Side Diff: tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate

Issue 29273005: CanvasRenderingContext2D.fillText now works correctly with null maxWidth. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
8 $!MEMBERS 8 $!MEMBERS
9 9
10 /** 10 /**
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 '#.lineDashOffset || #.webkitLineDashOffset', this, this); 258 '#.lineDashOffset || #.webkitLineDashOffset', this, this);
259 259
260 @DomName('CanvasRenderingContext2D.lineDashOffset') 260 @DomName('CanvasRenderingContext2D.lineDashOffset')
261 void set lineDashOffset(num value) => JS('void', 261 void set lineDashOffset(num value) => JS('void',
262 'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : ' 262 'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
263 '#.webkitLineDashOffset = #', this, this, value, this, value); 263 '#.webkitLineDashOffset = #', this, this, value, this, value);
264 $else 264 $else
265 // TODO(amouravski): Add Dartium native methods for drawImage once we figure 265 // TODO(amouravski): Add Dartium native methods for drawImage once we figure
266 // out how to not break native bindings. 266 // out how to not break native bindings.
267 $endif 267 $endif
268
269 /**
270 * Draws text to the canvas.
271 *
272 * The text is drawn starting at coordinates ([x], [y]).
273 * If [maxWidth] is provided and the [text] is computed to be wider than
274 * [maxWidth], then the drawn text is scaled down horizontally to fit.
275 *
276 * The text uses the current [CanvasRenderingContext2D.font] property for font
277 * options, such as typeface and size, and the current
278 * [CanvasRenderingContext2D.fillStyle] for style options such as color.
279 * The current [CanvasRenderingContext2D.textAlign] and
280 * [CanvasRenderingContext2D.textBaseLine] properties are also applied to the
281 * drawn text.
282 */
283 @DomName('CanvasRenderingContext2D.fillText')
284 void fillText(String text, num x, num y, [num maxWidth]) {
Emily Fortuna 2013/10/19 00:29:46 how about instead write this function this way: $
Andrei Mouravski 2013/10/21 19:39:09 Done.
285 $if DART2JS
286 if (maxWidth != null) {
287 _fillText(text, x, y, maxWidth);
288 } else {
289 _fillText(text, x, y);
290 }
291 $else
292 _fillText(text, x, y, maxWidth);
293 $endif
294 }
268 } 295 }
269
OLDNEW
« no previous file with comments | « tools/dom/scripts/htmlrenamer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698