| OLD | NEW |
| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 $if DART2JS | 255 $if DART2JS |
| 256 @DomName('CanvasRenderingContext2D.lineDashOffset') | 256 @DomName('CanvasRenderingContext2D.lineDashOffset') |
| 257 num get lineDashOffset => JS('num', | 257 num get lineDashOffset => JS('num', |
| 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 | |
| 265 @DomName('CanvasRenderingContext2D.getLineDash') | |
| 266 List<num> getLineDash() => _getLineDash(); | |
| 267 $else | 264 $else |
| 268 @DomName('CanvasRenderingContext2D.getLineDash') | |
| 269 List<num> getLineDash() { | |
| 270 var result = _getLineDash(); | |
| 271 if (result == null) { | |
| 272 result = []; | |
| 273 } | |
| 274 return result; | |
| 275 } | |
| 276 // TODO(amouravski): Add Dartium native methods for drawImage once we figure | 265 // TODO(amouravski): Add Dartium native methods for drawImage once we figure |
| 277 // out how to not break native bindings. | 266 // out how to not break native bindings. |
| 278 $endif | 267 $endif |
| 279 $if DART2JS | 268 $if DART2JS |
| 280 | 269 |
| 281 /** | 270 /** |
| 282 * Draws text to the canvas. | 271 * Draws text to the canvas. |
| 283 * | 272 * |
| 284 * The text is drawn starting at coordinates ([x], [y]). | 273 * The text is drawn starting at coordinates ([x], [y]). |
| 285 * If [maxWidth] is provided and the [text] is computed to be wider than | 274 * If [maxWidth] is provided and the [text] is computed to be wider than |
| (...skipping 10 matching lines...) Expand all Loading... |
| 296 void fillText(String text, num x, num y, [num maxWidth]) { | 285 void fillText(String text, num x, num y, [num maxWidth]) { |
| 297 if (maxWidth != null) { | 286 if (maxWidth != null) { |
| 298 JS('void', '#.fillText(#, #, #, #)', this, text, x, y, maxWidth); | 287 JS('void', '#.fillText(#, #, #, #)', this, text, x, y, maxWidth); |
| 299 } else { | 288 } else { |
| 300 JS('void', '#.fillText(#, #, #)', this, text, x, y); | 289 JS('void', '#.fillText(#, #, #)', this, text, x, y); |
| 301 } | 290 } |
| 302 } | 291 } |
| 303 $endif | 292 $endif |
| 304 } | 293 } |
| 305 | 294 |
| OLD | NEW |