@operato/scene-basic 7.0.1 → 7.3.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/scene-basic",
3
3
  "description": "basic component for things-scene",
4
4
  "author": "heartyoh",
5
- "version": "7.0.1",
5
+ "version": "7.3.19",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "license": "MIT",
@@ -27,7 +27,7 @@
27
27
  "migration": "things-factory-migration"
28
28
  },
29
29
  "dependencies": {
30
- "@hatiolab/things-scene": "^3.2.0",
30
+ "@hatiolab/things-scene": "^3.4.0",
31
31
  "@wizpanda/super-gif": "^0.0.6"
32
32
  },
33
33
  "devDependencies": {
@@ -58,5 +58,5 @@
58
58
  "prettier --write"
59
59
  ]
60
60
  },
61
- "gitHead": "575a4ccdeb952a605c9a6f65a389906e73a71013"
61
+ "gitHead": "ff73072a62ee02520f9d986d0095f6d329de64f9"
62
62
  }
package/CHANGELOG.md DELETED
@@ -1,224 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [7.0.1](https://github.com/things-scene/operato-scene/compare/v7.0.0...v7.0.1) (2024-06-30)
7
-
8
-
9
- ### :bug: Bug Fix
10
-
11
- * things-factory@7.0.0 ([f4cfe44](https://github.com/things-scene/operato-scene/commit/f4cfe44cb565e7b8fdc0df210a722b6526871848))
12
-
13
-
14
-
15
- ## [7.0.0](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.4...v7.0.0) (2024-06-30)
16
-
17
- **Note:** Version bump only for package @operato/scene-basic
18
-
19
-
20
-
21
-
22
-
23
- ## [7.0.0-rc.1](https://github.com/things-scene/operato-scene/compare/v7.0.0-rc.0...v7.0.0-rc.1) (2024-06-21)
24
-
25
-
26
- ### :bug: Bug Fix
27
-
28
- * apply v7-rc dependencies ([eee5612](https://github.com/things-scene/operato-scene/commit/eee5612e1d569387c284a7c6c49d64ef44b6d701))
29
-
30
-
31
-
32
- ## [7.0.0-rc.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-beta.8...v7.0.0-rc.0) (2024-06-21)
33
-
34
- **Note:** Version bump only for package @operato/scene-basic
35
-
36
-
37
-
38
-
39
-
40
- ## [2.0.0-beta.0](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.12...v2.0.0-beta.0) (2024-06-01)
41
-
42
-
43
- ### :rocket: New Features
44
-
45
- * 2.0.0-beta.0 ([a2e2869](https://github.com/things-scene/operato-scene/commit/a2e28694eedf5bab0c54bcab5432d54ec59edd7f))
46
-
47
-
48
- ### :bug: Bug Fix
49
-
50
- * allowJs in tsconfig option ([fa77174](https://github.com/things-scene/operato-scene/commit/fa771742188f21f177f0a85281570f59f0c478cf))
51
-
52
-
53
-
54
- ## [2.0.0-alpha.12](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-05-11)
55
-
56
-
57
- ### :bug: Bug Fix
58
-
59
- * ignore 'cache' folder for git and npm ([d70f811](https://github.com/things-scene/operato-scene/commit/d70f8118ff3e9248f80aa9435d6e6cbb8aacfcaf))
60
-
61
-
62
-
63
- ## [2.0.0-alpha.9](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) (2024-04-11)
64
-
65
-
66
- ### :bug: Bug Fix
67
-
68
- * things-factory@7.0.1 ([a9f4c18](https://github.com/things-scene/operato-scene/commit/a9f4c1873b80c540e4c2e16649e127ccffcf9a4c))
69
-
70
-
71
-
72
- ## [2.0.0-alpha.6](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-03-24)
73
-
74
-
75
- ### :bug: Bug Fix
76
-
77
- * translation ([266d423](https://github.com/things-scene/operato-scene/commit/266d423d9d6992464f45a437acc90ccf8ed33bf6))
78
-
79
-
80
-
81
- ## [2.0.0-alpha.4](https://github.com/things-scene/operato-scene/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-03-21)
82
-
83
-
84
- ### :bug: Bug Fix
85
-
86
- * 컴포넌트 명 다국어 ([3616a52](https://github.com/things-scene/operato-scene/commit/3616a52e2f0268c83c976c6b4deeffc016f91e46))
87
-
88
-
89
-
90
- ## [2.0.0-alpha.0](https://github.com/things-scene/operato-scene/compare/v1.3.9...v2.0.0-alpha.0) (2024-01-14)
91
-
92
-
93
- ### :bug: Bug Fix
94
-
95
- * 2.0.0-alpha.0 ([93274e3](https://github.com/things-scene/operato-scene/commit/93274e36c5d184f339f83899654dd48b4786ac2b))
96
-
97
-
98
-
99
- ## [1.2.90](https://github.com/things-scene/operato-scene/compare/v1.2.89...v1.2.90) (2023-11-22)
100
-
101
- **Note:** Version bump only for package @operato/scene-basic
102
-
103
-
104
-
105
-
106
-
107
- ## [1.2.87](https://github.com/things-scene/operato-scene/compare/v1.2.86...v1.2.87) (2023-11-10)
108
-
109
- **Note:** Version bump only for package @operato/scene-basic
110
-
111
-
112
-
113
-
114
-
115
- ## [1.2.76](https://github.com/things-scene/operato-scene/compare/v1.2.75...v1.2.76) (2023-10-28)
116
-
117
-
118
- ### :bug: Bug Fix
119
-
120
- * scene-tab ([ad62f96](https://github.com/things-scene/operato-scene/commit/ad62f967b149eb5adf8f2e0714d79e8a9dc7186c))
121
-
122
-
123
-
124
- ## [1.2.71](https://github.com/things-scene/operato-scene/compare/v1.2.70...v1.2.71) (2023-10-11)
125
-
126
-
127
- ### :bug: Bug Fix
128
-
129
- * add bluetooth module ([4bba13c](https://github.com/things-scene/operato-scene/commit/4bba13c7ac29508d37f5751ea5abdded60fa314d))
130
-
131
-
132
-
133
- ## [1.2.66](https://github.com/things-scene/operato-scene/compare/v1.2.65...v1.2.66) (2023-09-14)
134
-
135
- **Note:** Version bump only for package @operato/scene-basic
136
-
137
-
138
-
139
-
140
-
141
- ## [1.2.65](https://github.com/things-scene/operato-scene/compare/v1.2.64...v1.2.65) (2023-09-14)
142
-
143
- **Note:** Version bump only for package @operato/scene-basic
144
-
145
-
146
-
147
-
148
-
149
- ## [1.2.62](https://github.com/things-scene/operato-scene/compare/v1.2.61...v1.2.62) (2023-09-11)
150
-
151
- **Note:** Version bump only for package @operato/scene-basic
152
-
153
-
154
-
155
-
156
-
157
- ## [1.2.49](https://github.com/things-scene/operato-scene/compare/v1.2.48...v1.2.49) (2023-06-26)
158
-
159
-
160
- ### :bug: Bug Fix
161
-
162
- * missing .npmignore ([61ba4f2](https://github.com/things-scene/operato-scene/commit/61ba4f2ae22a865d700a971d62eb01f950c34d0e))
163
-
164
-
165
-
166
- ## [1.2.46](https://github.com/things-scene/operato-scene/compare/v1.2.45...v1.2.46) (2023-06-10)
167
-
168
-
169
- ### :bug: Bug Fix
170
-
171
- * typescript build options ([3eb0d7f](https://github.com/things-scene/operato-scene/commit/3eb0d7fd80e2c3cea698501aa1d9d54903423a7b))
172
-
173
-
174
-
175
- ## [1.2.45](https://github.com/things-scene/operato-scene/compare/v1.2.44...v1.2.45) (2023-06-09)
176
-
177
-
178
- ### :bug: Bug Fix
179
-
180
- * set => setState, get => getState for whole scene component ([c205db4](https://github.com/things-scene/operato-scene/commit/c205db4c7bfa5c6dd7d34ea82af283d83b551bad))
181
-
182
-
183
-
184
- ## [1.2.36](https://github.com/things-scene/operato-scene/compare/v1.2.35...v1.2.36) (2023-05-13)
185
-
186
-
187
- ### :bug: Bug Fix
188
-
189
- * license ([d37d485](https://github.com/things-scene/operato-scene/commit/d37d48597407dea1ad022e674f2899720e56d695))
190
-
191
-
192
-
193
- ## [1.2.29](https://github.com/things-scene/operato-scene/compare/v1.2.28...v1.2.29) (2023-04-30)
194
-
195
-
196
- ### :bug: Bug Fix
197
-
198
- * update module's version ([047d08b](https://github.com/things-scene/operato-scene/commit/047d08b5d912d12c04b2f6b63156d1e812588365))
199
-
200
-
201
-
202
- ### [1.2.27](https://github.com/things-scene/operato-scene/compare/v1.2.26...v1.2.27) (2023-04-22)
203
-
204
- **Note:** Version bump only for package @operato/scene-basic
205
-
206
-
207
-
208
-
209
-
210
- ### [1.2.13](https://github.com/things-scene/operato-scene/compare/v1.2.12...v1.2.13) (2023-03-05)
211
-
212
-
213
- ### :bug: Bug Fix
214
-
215
- * lighten data binding for 3d objects ([09db97e](https://github.com/things-scene/operato-scene/commit/09db97e1fe70563a734113e70538bdf6d18c6bc7))
216
-
217
-
218
-
219
- ### [1.2.5](https://github.com/things-scene/operato-scene/compare/v1.2.4...v1.2.5) (2023-02-20)
220
-
221
-
222
- ### :bug: Bug Fix
223
-
224
- * add scene-basic module ([b6f11ae](https://github.com/things-scene/operato-scene/commit/b6f11ae7d073dfd09201607fcb6cd7801da096e3))
package/demo/index.html DELETED
@@ -1,158 +0,0 @@
1
- <!DOCTYPE html>
2
- <!--
3
- @license
4
- Copyright © HatioLab Inc. All rights reserved.
5
- -->
6
- <html>
7
- <head>
8
- <meta charset="utf-8" />
9
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes" />
10
- <title>things-scene-basic Demo</title>
11
- <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
12
-
13
- <link rel="import" href="../../things-scene-viewer/things-scene-viewer.html" />
14
- <link rel="import" href="../../things-scene-viewer/things-scene-layer.html" />
15
- <link rel="import" href="../../things-scene-viewer/things-scene-handler.html" />
16
-
17
- <link rel="import" href="../../things-designer-elements/things-editor-color.html" />
18
- <link rel="import" href="../../things-designer-elements/things-editor-color-stops.html" />
19
- <link rel="import" href="../../things-designer-elements/things-editor-properties.html" />
20
- <link rel="import" href="../../things-scene-modeler/things-scene-properties.html" />
21
-
22
- <link rel="import" href="./things-scene-basic.html" />
23
-
24
- <style is="custom-style">
25
- @font-face {
26
- font-family: 'Bitstream Vera Serif Bold';
27
- src: url('fonts/VeraSeBd.ttf');
28
- }
29
-
30
- things-scene-viewer {
31
- display: block;
32
- width: 900px;
33
- height: 600px;
34
- }
35
- </style>
36
- </head>
37
- <body unresolved>
38
- <template is="dom-bind" id="app">
39
- <p>An example of <code>&lt;things-scene-basic&gt;</code>:</p>
40
-
41
- <things-scene-viewer id="scene" scene="{{scene}}" selected="{{selected}}" model="[[model]]" mode="1">
42
- <things-scene-layer type="selection-layer"></things-scene-layer>
43
- <things-scene-layer type="modeling-layer"></things-scene-layer>
44
- <things-scene-handler type="text-editor"></things-scene-handler>
45
- <things-scene-handler type="move-handler"></things-scene-handler>
46
- </things-scene-viewer>
47
-
48
- <fieldset class="same-width">
49
- <legend>basic style</legend>
50
- <things-scene-properties scene="[[scene]]" selected="[[selected]]" model="{{target}}" bounds="{{bounds}}">
51
- <things-editor-properties id="properties" target="{{target}}" props="{{props}}"> </things-editor-properties>
52
- </things-scene-properties>
53
- </fieldset>
54
-
55
- <button id="change">Change Value</button>
56
- </template>
57
-
58
- <script>
59
- window.addEventListener('WebComponentsReady', function (e) {
60
- var app = document.querySelector('#app')
61
-
62
- app.$.change.addEventListener('click', function () {
63
- var viewer = app.$.scene
64
- viewer.findAll('basic-analog')[0].set('value', 0 + Math.round(Math.random() * 240))
65
- viewer.findAll('basic-analog')[0].set('colorStops', [
66
- { position: 40, color: '#00ff00' },
67
- { position: 70, color: '#ffff00' },
68
- { position: 170, color: '#ff0000' }
69
- ])
70
- })
71
-
72
- app.model = {
73
- width: 1500,
74
- height: 1500,
75
- components: [
76
- {
77
- type: 'basic-analog',
78
- cx: 300,
79
- cy: 300,
80
- rx: 100,
81
- ry: 100,
82
- hourWidth: 3,
83
- minuteWidth: 2,
84
- fillStyle: '',
85
- strokeStyle: '#FF0000',
86
- fontColor: '#0000FF',
87
- lineWidth: 5,
88
- innerCircleSize: 20,
89
- innerCircleColor: '#00FF00'
90
- // }, {
91
- // type: 'basic-text',
92
- // top: 300,
93
- // left: 800,
94
- // width: 100,
95
- // height: 50,
96
- // fillStyle: '#ff00ff',
97
- // fontColor: '#FF0000',
98
- // lineWidth: 5,
99
- // localTime: true,
100
- // utc : 10
101
- }
102
- ]
103
- }
104
-
105
- app.props = [
106
- {
107
- type: 'number',
108
- label: 'hourwidth',
109
- name: 'hourWidth',
110
- property: 'hourWidth'
111
- },
112
- {
113
- type: 'number',
114
- label: 'minute-width',
115
- name: 'minuteWidth',
116
- property: 'minuteWidth'
117
- },
118
- {
119
- type: 'number',
120
- label: 'second-width',
121
- name: 'secondWidth',
122
- property: 'secondWidth'
123
- },
124
- {
125
- type: 'checkbox',
126
- label: 'needle-round',
127
- name: 'needleRound',
128
- property: 'needleRound'
129
- },
130
- {
131
- type: 'checkbox',
132
- label: 'show-second',
133
- name: 'showSecond',
134
- property: 'showSecond'
135
- },
136
- {
137
- type: 'checkbox',
138
- label: 'show-number',
139
- name: 'showNumber',
140
- property: 'showNumber'
141
- },
142
- {
143
- type: 'number',
144
- label: 'inner-circle-size',
145
- name: 'innerCircleSize',
146
- property: 'innerCircleSize'
147
- },
148
- {
149
- type: 'color',
150
- label: 'inner-circle-color',
151
- name: 'innerCircleColor',
152
- property: 'innerCircleColor'
153
- }
154
- ]
155
- })
156
- </script>
157
- </body>
158
- </html>
@@ -1,6 +0,0 @@
1
- <!--
2
- @license
3
- Copyright © HatioLab Inc. All rights reserved.
4
- -->
5
- <script src="../../moment/moment.js"></script>
6
- <script src="../things-scene-basic.js"></script>
@@ -1,46 +0,0 @@
1
- import { Anchor, Component } from '@hatiolab/things-scene'
2
-
3
- /**
4
- * @function ellipseAnchors
5
- * @param {Component} component
6
- * @return {Anchor[]}
7
- */
8
- export default function ellipseAnchors(component: Component): Anchor[] {
9
- var { left, top, width, height } = component.bounds
10
-
11
- var centerx = left + width / 2
12
- var centery = top + height / 2
13
- var right = left + width
14
- var bottom = top + height
15
-
16
- return [
17
- {
18
- name: 'TOP',
19
- position: {
20
- x: centerx,
21
- y: top
22
- }
23
- },
24
- {
25
- name: 'RIGHT',
26
- position: {
27
- x: right,
28
- y: centery
29
- }
30
- },
31
- {
32
- name: 'BOTTOM',
33
- position: {
34
- x: centerx,
35
- y: bottom
36
- }
37
- },
38
- {
39
- name: 'LEFT',
40
- position: {
41
- x: left,
42
- y: centery
43
- }
44
- }
45
- ]
46
- }
package/src/audio.ts DELETED
@@ -1,173 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { Component, ComponentNature, Properties, RectPath, Shape } from '@hatiolab/things-scene'
6
-
7
- const NATURE: ComponentNature = {
8
- mutable: false,
9
- resizable: true,
10
- rotatable: true,
11
- properties: [
12
- {
13
- type: 'string',
14
- label: 'src',
15
- name: 'src'
16
- },
17
- {
18
- type: 'checkbox',
19
- label: 'started',
20
- name: 'started'
21
- },
22
- {
23
- type: 'checkbox',
24
- label: 'loop',
25
- name: 'loop'
26
- }
27
- ],
28
- 'value-property': 'src',
29
- help: 'scene/component/audio'
30
- }
31
-
32
- const AUDIO_IMAGE =
33
- 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAMAAAC3Ycb+AAAAP1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACzJYIvAAAAFHRSTlMA8BAwgNBgQKB/wCBwUJDg37CvXyUlBK8AABFYSURBVHja7NsBkqIwFIThTiAQgyBq3/+sm6p1tnamZkaTMhJJf1f4S/JeEIiIiIiIiIiIiIiIiEhD7Hg4BH84TpAKjJ4f3NFCtjVd+InXz2RTs+FXlxGylYHfcVfIJmb+YFWSLUyGVJKKBJJKUo+Rd6w63l/qzLuCkryO5fe0l2xk5mMWbe+v0fNBRqf7S3je6CipQ2ACr+dWcYEpzBFS1plpguatsnomMgdIQSOTuQ5SjmE6/UgK8szgdJIUM/FG41YlFmYJ2kkKsY5ZzAwBurHDk3WGeRY0bvYrGa1+rqNI22f7dS32ZnUK1GMr0eSK3mEc9dhKMxp+ZTo8kT2emOXS5LQ1kCxbJBocSd2k5PaIjMVzjWcdJPk9ooBnmzx1t5Xb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i16s+jJKejhywLooz68yiMEcHr2qM4h81CJ++VPJfTu5UwBpv4Pp9DJSi6MJx0bvUwiw4ewgT8zNR0LHUL+OccOpY/3ElzyGKD5pBlMJpDlsOkMythRoNbXh95PJsdA67MrMtAEYbjeDqNo+7oKqWUUkoppZRSSimllFJKFfMXp4vmSjB8n6sAAAAASUVORK5CYII='
34
-
35
- export default class AudioPlayer extends RectPath(Shape) {
36
- static IMAGE: HTMLImageElement
37
-
38
- static get image() {
39
- if (!AudioPlayer.IMAGE) {
40
- AudioPlayer.IMAGE = new Image()
41
- AudioPlayer.IMAGE.src = AUDIO_IMAGE
42
- }
43
-
44
- return AudioPlayer.IMAGE
45
- }
46
-
47
- _audio: any
48
-
49
- dispose() {
50
- super.dispose()
51
-
52
- this.started = false
53
- delete this._audio
54
- }
55
-
56
- ready() {
57
- super.ready()
58
-
59
- this._audio = new Audio()
60
-
61
- this._audio.addEventListener('canplay', () => {
62
- this.started && this._audio.play()
63
- })
64
-
65
- var { src = '', loop = false, started = false } = this.state
66
-
67
- this.onchangeSrc(src)
68
- this.onchangeLoop(loop)
69
- this.onchangeStarted(started)
70
- }
71
-
72
- render(ctx: CanvasRenderingContext2D) {
73
- var { left, top, width, height, src } = this.state
74
-
75
- ctx.beginPath()
76
-
77
- this.drawImage(ctx, AudioPlayer.image, left, top, width, height)
78
- }
79
-
80
- get nature() {
81
- return NATURE
82
- }
83
-
84
- get hasTextProperty() {
85
- return false
86
- }
87
-
88
- get src() {
89
- return this.getState('src')
90
- }
91
-
92
- set src(src) {
93
- this.setState('src', src)
94
- }
95
-
96
- get started() {
97
- return !!this.getState('started')
98
- }
99
-
100
- set started(started) {
101
- this.setState('started', started)
102
- }
103
-
104
- start() {
105
- if (!this._audio) return
106
-
107
- this._audio.classList.add('active')
108
- this._audio.play()
109
- }
110
-
111
- pause() {
112
- if (!this._audio) return
113
-
114
- this._audio.classList.remove('active')
115
- this._audio.pause()
116
- }
117
-
118
- onchangeSrc(src: string) {
119
- try {
120
- // this._audio.crossOrigin = "anonymous";
121
- if (String(src).substring(0, 4) !== 'data') this._audio.crossOrigin = 'use-credentials'
122
- else this._audio.crossOrigin = null
123
-
124
- this._audio.src = typeof src === 'string' ? this.app.url(src) : src
125
- } catch (e) {
126
- console.error(e)
127
- return
128
- }
129
- }
130
-
131
- onchangeStarted(started: boolean) {
132
- const audio = this._audio
133
-
134
- if (started) {
135
- /*
136
- [ audio/video.readyState ]
137
- 0 = HAVE_NOTHING - no information whether or not the audio/video is ready
138
- 1 = HAVE_METADATA - metadata for the audio/video is ready
139
- 2 = HAVE_CURRENT_DATA - data for the current playback position is available, but not enough data to play next frame/millisecond
140
- 3 = HAVE_FUTURE_DATA - data for the current and at least the next frame is available
141
- 4 = HAVE_ENOUGH_DATA - enough data available to start playing
142
- */
143
- audio.readyState == 4 && audio.play()
144
- } else {
145
- audio.pause()
146
- }
147
- }
148
-
149
- onchangeLoop(loop: boolean) {
150
- this._audio.loop = loop
151
- }
152
-
153
- onchange(after: Properties, before: Properties) {
154
- 'src' in after && this.onchangeSrc(after.src)
155
- 'started' in after && this.onchangeStarted(after.started)
156
- 'loop' in after && this.onchangeLoop(after.loop)
157
- }
158
-
159
- ondblclick(e: MouseEvent) {
160
- this.started = !this.started
161
- }
162
-
163
- ondropfile(transfered: DataTransferItemList, files: FileList) {
164
- for (let i = 0; i < transfered.length; i++) {
165
- if (transfered[i].type.startsWith('audio/')) {
166
- this.src = files[i]
167
- return
168
- }
169
- }
170
- }
171
- }
172
-
173
- Component.register('audio', AudioPlayer)
package/src/cloud.ts DELETED
@@ -1,40 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import { Component } from '@hatiolab/things-scene'
6
-
7
- export default class Cloud extends Component {
8
- prerender(ctx: CanvasRenderingContext2D) {
9
- //TODO center()를 구현할 때까지, 아무 구현없이 오버라이드한다.
10
- }
11
-
12
- render(ctx: CanvasRenderingContext2D) {
13
- var { x, y } = this.state
14
-
15
- ctx.beginPath()
16
-
17
- ctx.moveTo(x, y)
18
-
19
- ctx.bezierCurveTo(x - 40, y + 20, x - 40, y + 70, x + 50, y + 70)
20
- ctx.bezierCurveTo(x + 80, y + 100, x + 150, y + 100, x + 170, y + 70)
21
- ctx.bezierCurveTo(x + 250, y + 70, x + 250, y + 40, x + 220, y + 30)
22
- ctx.bezierCurveTo(x + 260, y - 40, x + 200, y - 50, x + 170, y - 30)
23
- ctx.bezierCurveTo(x + 150, y - 75, x + 80, y - 60, x + 80, y - 30)
24
- ctx.bezierCurveTo(x + 30, y - 75, x - 20, y - 60, x, y)
25
-
26
- ctx.closePath()
27
- }
28
-
29
- get path() {
30
- var { x, y } = this.state
31
-
32
- return [{ x, y }]
33
- }
34
-
35
- set path(path) {
36
- /* do nothing */
37
- }
38
- }
39
-
40
- Component.register('cloud', Cloud)