OLD | NEW |
1 define(['dart_sdk'], function(dart_sdk) { | 1 define(['dart_sdk'], function(dart_sdk) { |
2 'use strict'; | 2 'use strict'; |
3 const core = dart_sdk.core; | 3 const core = dart_sdk.core; |
4 const html = dart_sdk.html; | 4 const html = dart_sdk.html; |
5 const math = dart_sdk.math; | 5 const math = dart_sdk.math; |
6 const dart = dart_sdk.dart; | 6 const dart = dart_sdk.dart; |
7 const dartx = dart_sdk.dartx; | 7 const dartx = dart_sdk.dartx; |
8 const sunflower = Object.create(null); | 8 const sunflower = Object.create(null); |
9 const circle = Object.create(null); | 9 const circle = Object.create(null); |
10 const painter = Object.create(null); | 10 const painter = Object.create(null); |
11 let StringToElement = () => (StringToElement = dart.constFn(dart.definiteFunct
ionType(html.Element, [core.String])))(); | 11 let StringToElement = () => (StringToElement = dart.constFn(dart.fnType(html.E
lement, [core.String])))(); |
12 let EventTovoid = () => (EventTovoid = dart.constFn(dart.definiteFunctionType(
dart.void, [html.Event])))(); | 12 let EventTovoid = () => (EventTovoid = dart.constFn(dart.fnType(dart.void, [ht
ml.Event])))(); |
13 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); | 13 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.fnType(dart.void, [])))
(); |
14 dart.defineLazy(sunflower, { | 14 dart.defineLazy(sunflower, { |
15 get SEED_RADIUS() { | 15 get SEED_RADIUS() { |
16 return 2; | 16 return 2; |
17 }, | 17 }, |
18 get SCALE_FACTOR() { | 18 get SCALE_FACTOR() { |
19 return 4; | 19 return 4; |
20 }, | 20 }, |
21 get MAX_D() { | 21 get MAX_D() { |
22 return 300; | 22 return 300; |
23 }, | 23 }, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 context[dartx.arc](this.x, this.y, this.radius, 0, painter.TAU, false); | 124 context[dartx.arc](this.x, this.y, this.radius, 0, painter.TAU, false); |
125 context[dartx.fill](); | 125 context[dartx.fill](); |
126 context.closePath(); | 126 context.closePath(); |
127 context.stroke(); | 127 context.stroke(); |
128 } | 128 } |
129 }; | 129 }; |
130 const color = Symbol("CirclePainter.color"); | 130 const color = Symbol("CirclePainter.color"); |
131 painter.CirclePainter[dart.implements] = () => [circle.Circle]; | 131 painter.CirclePainter[dart.implements] = () => [circle.Circle]; |
132 dart.setSignature(painter.CirclePainter, { | 132 dart.setSignature(painter.CirclePainter, { |
133 fields: () => ({color: dart.fieldType(core.String)}), | 133 fields: () => ({color: dart.fieldType(core.String)}), |
134 methods: () => ({draw: dart.definiteFunctionType(dart.void, [html.CanvasRend
eringContext2D])}) | 134 methods: () => ({draw: dart.fnType(dart.void, [html.CanvasRenderingContext2D
])}) |
135 }); | 135 }); |
136 sunflower.SunflowerSeed = class SunflowerSeed extends dart.mixin(circle.Circle
, painter.CirclePainter) { | 136 sunflower.SunflowerSeed = class SunflowerSeed extends dart.mixin(circle.Circle
, painter.CirclePainter) { |
137 new(x, y, radius, color) { | 137 new(x, y, radius, color) { |
138 if (color === void 0) color = null; | 138 if (color === void 0) color = null; |
139 super.new(x, y, radius); | 139 super.new(x, y, radius); |
140 if (color != null) this.color = color; | 140 if (color != null) this.color = color; |
141 } | 141 } |
142 }; | 142 }; |
143 dart.defineLazy(painter, { | 143 dart.defineLazy(painter, { |
144 get ORANGE() { | 144 get ORANGE() { |
(...skipping 28 matching lines...) Expand all Loading... |
173 }, null); | 173 }, null); |
174 // Exports: | 174 // Exports: |
175 return { | 175 return { |
176 sunflower: sunflower, | 176 sunflower: sunflower, |
177 circle: circle, | 177 circle: circle, |
178 painter: painter | 178 painter: painter |
179 }; | 179 }; |
180 }); | 180 }); |
181 | 181 |
182 //# sourceMappingURL=sunflower.js.map | 182 //# sourceMappingURL=sunflower.js.map |
OLD | NEW |