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