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