uil 1.0.0 → 4.0.2

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.
@@ -1,254 +0,0 @@
1
- import { Tools } from '../core/Tools';
2
- import { Proto } from '../core/Proto';
3
- //import { add } from '../core/Gui';
4
- import { add } from '../core/add';
5
-
6
- function Group ( o ) {
7
-
8
- Proto.call( this, o );
9
-
10
- this.autoHeight = true;
11
- this.isGroup = true;
12
-
13
- //this.bg = o.bg || null;
14
-
15
-
16
- //this.h = 25;
17
- this.baseH = this.h;
18
- var fltop = Math.floor(this.h*0.5)-6;
19
-
20
- this.isOpen = o.open || false;
21
-
22
- this.c[2] = Tools.dom( 'div', Tools.css.basic + 'width:100%; left:0; height:auto; overflow:hidden; top:'+this.h+'px');
23
- this.c[3] = Tools.dom( 'path', Tools.css.basic + 'position:absolute; width:10px; height:10px; left:0; top:'+fltop+'px;', { d:Tools.GPATH, fill:this.fontColor, stroke:'none'});
24
- this.c[4] = Tools.dom( 'path', Tools.css.basic + 'position:absolute; width:10px; height:10px; left:4px; top:'+fltop+'px;', { d:'M 3 8 L 8 5 3 2 3 8 Z', fill:this.fontColor, stroke:'none'});
25
- // bottom line
26
- this.c[5] = Tools.dom( 'div', Tools.css.basic + 'background:rgba(255, 255, 255, 0.2); width:100%; left:0; height:1px; bottom:0px');
27
-
28
- var s = this.s;
29
-
30
- s[0].height = this.h + 'px';
31
- s[1].height = this.h + 'px';
32
- //s[1].top = 4 + 'px';
33
- //s[1].left = 4 + 'px';
34
- s[1].pointerEvents = 'auto';
35
- s[1].cursor = 'pointer';
36
- this.c[1].name = 'group';
37
-
38
- this.s[1].marginLeft = '10px';
39
- this.s[1].lineHeight = this.h-4;
40
- this.s[1].color = this.fontColor;
41
- this.s[1].fontWeight = 'bold';
42
-
43
- this.uis = [];
44
-
45
- this.c[1].events = [ 'click' ];
46
-
47
- this.init();
48
-
49
- if( o.bg !== undefined ) this.setBG(o.bg);
50
-
51
- if( this.isOpen ) this.open();
52
-
53
- };
54
-
55
- Group.prototype = Object.create( Proto.prototype );
56
- Group.prototype.constructor = Group;
57
-
58
- Group.prototype.setBG = function( c ){
59
-
60
- this.s[0].background = c;
61
-
62
- var i = this.uis.length;
63
- while(i--){
64
- this.uis[i].setBG( c );
65
- }
66
-
67
- };
68
-
69
- Group.prototype.handleEvent = function( e ) {
70
-
71
- e.preventDefault();
72
- //e.stopPropagation();
73
-
74
- switch( e.type ) {
75
- case 'click': this.click( e ); break;
76
- }
77
-
78
- };
79
-
80
-
81
- Group.prototype.click = function( e ){
82
-
83
- if( this.isOpen ) this.close();
84
- else this.open();
85
-
86
- };
87
-
88
- Group.prototype.add = function( ){
89
-
90
- var a = arguments;
91
-
92
- if( typeof a[1] === 'object' ){
93
- a[1].isUI = this.isUI;
94
- a[1].target = this.c[2];
95
- a[1].main = this.main;
96
- } else if( typeof arguments[1] === 'string' ){
97
- if( a[2] === undefined ) [].push.call(a, { isUI:true, target:this.c[2], main:this.main });
98
- else{
99
- a[2].isUI = true;
100
- a[2].target = this.c[2];
101
- a[1].main = this.main;
102
- }
103
- }
104
-
105
- var n = add.apply( this, a );
106
- this.uis.push( n );
107
-
108
- n.py = this.h;
109
-
110
- if( !n.autoWidth ){
111
- var y = n.c[0].getBoundingClientRect().top;
112
- if( this.prevY !== y ){
113
- this.calc( n.h + 1 );
114
- this.prevY = y;
115
- }
116
- }else{
117
- this.prevY = -1;
118
- this.calc( n.h + 1 );
119
- }
120
-
121
- if( n.autoHeight ) n.parentGroup = this;
122
-
123
- return n;
124
-
125
- }
126
-
127
- /*Group.prototype.add = function( ){
128
-
129
- var a = arguments;
130
-
131
- if( typeof a[1] === 'object' ){
132
- a[1].isUI = this.isUI;
133
- a[1].target = this.c[2];
134
- } else if( typeof arguments[1] === 'string' ){
135
- if( a[2] === undefined ) [].push.call(a, { isUI:true, target:this.c[2] });
136
- else{
137
- a[2].isUI = true;
138
- a[2].target = this.c[2];
139
- }
140
- }
141
-
142
- //var n = Gui.prototype.add.apply( this, a );
143
- var n = Gui.prototype.add.call( this, a );
144
- //var n = add.apply( this, a );
145
- if( n.autoHeight ) n.parentGroup = this;
146
-
147
- return n;
148
-
149
- };*/
150
-
151
- Group.prototype.open = function(){
152
-
153
- this.isOpen = true;
154
- Tools.setSvg( this.c[4], 'd','M 5 8 L 8 3 2 3 5 8 Z');
155
- //this.s[4].background = UIL.F1;
156
- this.rSizeContent();
157
-
158
- if( this.isUI ) this.main.calc( this.h - this.baseH );
159
-
160
- };
161
-
162
- Group.prototype.close = function(){
163
-
164
- if( this.isUI ) this.main.calc(-(this.h-this.baseH ));
165
-
166
- this.isOpen = false;
167
- //this.s[4].background = UIL.F0;
168
- Tools.setSvg( this.c[4], 'd','M 3 8 L 8 5 3 2 3 8 Z');
169
- this.h = this.baseH;
170
-
171
- this.s[0].height = this.h + 'px';
172
-
173
- };
174
-
175
- Group.prototype.clear = function(){
176
-
177
- this.clearGroup();
178
- if( this.isUI ) this.main.calc( -(this.h +1 ));
179
- Proto.prototype.clear.call( this );
180
-
181
- };
182
-
183
- Group.prototype.clearGroup = function(){
184
-
185
- this.close();
186
-
187
- var i = this.uis.length;
188
- while(i--){
189
- this.uis[i].clear();
190
- this.uis.pop();
191
- }
192
- this.uis = [];
193
-
194
- //if( this.isUI ) this.main.calc( -this.h+ this.baseH );
195
-
196
- this.h = this.baseH;
197
- //this.s[0].height = this.h + 'px';
198
- //this.s[2].height = 0;
199
-
200
-
201
-
202
-
203
- //this.calc();
204
-
205
- };
206
-
207
- Group.prototype.calc = function( y ){
208
-
209
- if( !this.isOpen ) return;
210
-
211
- //this.h = this.baseH;
212
-
213
- if( y !== undefined ){
214
- this.h += y;
215
- if( this.isUI ) this.main.calc( y );
216
-
217
- }
218
- else this.h = this.c[2].offsetHeight + this.baseH;
219
-
220
- //var total = this.c[2].offsetHeight;
221
- //this.h += total;
222
-
223
- this.s[0].height = this.h + 'px';
224
-
225
- //
226
-
227
- };
228
-
229
- Group.prototype.rSizeContent = function(){
230
-
231
- var i = this.uis.length;
232
- while(i--){
233
- this.uis[i].setSize( this.width );
234
- this.uis[i].rSize();
235
- }
236
- this.calc();
237
-
238
- };
239
-
240
- Group.prototype.rSize = function(){
241
-
242
- Proto.prototype.rSize.call( this );
243
-
244
- var s = this.s;
245
-
246
- s[3].left = ( this.sa + this.sb - 17 ) + 'px';
247
- s[1].width = this.width + 'px';
248
- s[2].width = this.width + 'px';
249
-
250
- if(this.isOpen) this.rSizeContent();
251
-
252
- };
253
-
254
- export { Group };
@@ -1,265 +0,0 @@
1
- import { Tools } from '../core/Tools';
2
- import { Proto } from '../core/Proto';
3
-
4
- function Joystick ( o ) {
5
-
6
- Proto.call( this, o );
7
-
8
- this.autoWidth = false;
9
-
10
- this.value = [0,0];
11
-
12
- this.joyType = 'analogique';
13
-
14
- this.precision = o.precision || 2;
15
- this.multiplicator = o.multiplicator || 1;
16
-
17
- this.x = 0;
18
- this.y = 0;
19
-
20
- this.oldx = 0;
21
- this.oldy = 0;
22
-
23
- this.interval = null;
24
-
25
- this.radius = o.radius || 50;
26
-
27
- this.width = (this.radius*2)+20;
28
-
29
- if(o.width !== undefined){
30
- this.width = o.width;
31
- this.radius = ~~ (( this.width-20 )*0.5);
32
- }
33
- if(o.size !== undefined){
34
- this.width = o.size;
35
- this.radius = ~~ (this.width-20)*0.5;
36
- }
37
-
38
- this.innerRadius = o.innerRadius || this.radius*0.6;
39
- this.maxDistance = this.radius - this.innerRadius - 5;
40
- this.height = this.radius*2;
41
- this.h = o.height || (this.height + 40);
42
-
43
- this.top = 0;
44
-
45
- this.c[0].style.width = this.width +'px';
46
-
47
- if(this.c[1] !== undefined) {
48
-
49
- this.c[1].style.width = this.width +'px';
50
- this.c[1].style.textAlign = 'center';
51
- this.top = 20;
52
-
53
- }
54
-
55
- this.c[2] = Tools.dom( 'circle', Tools.css.basic + 'left:10px; top:'+this.top+'px; width:'+this.w+'px; height:'+this.height+'px; pointer-events:auto; cursor:pointer;', { cx:this.radius, cy:this.radius, r:this.radius, fill:'url(#grad)' });
56
- this.c[3] = Tools.dom( 'circle', Tools.css.basic + 'left:0px; top:'+(this.top-10)+'px; width:'+(this.w+20)+'px; height:'+(this.height+20)+'px;', { cx:this.radius+10, cy:this.radius+10, r:this.innerRadius+10, fill:'url(#gradS)'});
57
- this.c[4] = Tools.dom( 'circle', Tools.css.basic + 'left:10px; top:'+this.top+'px; width:'+this.w+'px; height:'+this.height+'px;', { cx:this.radius, cy:this.radius, r:this.innerRadius, fill:'url(#gradIn)', 'stroke-width':1, stroke:'#000' });
58
- this.c[5] = Tools.dom( 'div', Tools.css.txt + 'text-align:center; top:'+(this.height+20)+'px; width:'+this.width+'px; color:'+ this.fontColor );
59
-
60
- // gradian bakground
61
- var svg = this.c[2];
62
- Tools.dom( 'defs', null, {}, svg );
63
- Tools.dom( 'radialGradient', null, {id:'grad', cx:'50%', cy:'50%', r:'50%', fx:'50%', fy:'50%' }, svg, 1 );
64
- Tools.dom( 'stop', null, { offset:'40%', style:'stop-color:rgb(0,0,0); stop-opacity:0.3;' }, svg, [1,0] );
65
- Tools.dom( 'stop', null, { offset:'80%', style:'stop-color:rgb(0,0,0); stop-opacity:0;' }, svg, [1,0] );
66
- Tools.dom( 'stop', null, { offset:'90%', style:'stop-color:rgb(50,50,50); stop-opacity:0.4;' }, svg, [1,0] );
67
- Tools.dom( 'stop', null, { offset:'100%', style:'stop-color:rgb(50,50,50); stop-opacity:0;' }, svg, [1,0] );
68
-
69
- // gradian shadow
70
- svg = this.c[3];
71
- Tools.dom( 'defs', null, {}, svg );
72
- Tools.dom( 'radialGradient', null, {id:'gradS', cx:'50%', cy:'50%', r:'50%', fx:'50%', fy:'50%' }, svg, 1 );
73
- Tools.dom( 'stop', null, { offset:'60%', style:'stop-color:rgb(0,0,0); stop-opacity:0.5;' }, svg, [1,0] );
74
- Tools.dom( 'stop', null, { offset:'100%', style:'stop-color:rgb(0,0,0); stop-opacity:0;' }, svg, [1,0] );
75
-
76
- // gradian stick
77
-
78
- var cc0 = ['rgb(40,40,40)', 'rgb(48,48,48)', 'rgb(30,30,30)'];
79
- var cc1 = ['rgb(1,90,197)', 'rgb(3,95,207)', 'rgb(0,65,167)'];
80
-
81
- svg = this.c[4];
82
- Tools.dom( 'defs', null, {}, svg );
83
- Tools.dom( 'radialGradient', null, {id:'gradIn', cx:'50%', cy:'50%', r:'50%', fx:'50%', fy:'50%' }, svg, 1 );
84
- Tools.dom( 'stop', null, { offset:'30%', style:'stop-color:'+cc0[0]+'; stop-opacity:1;' }, svg, [1,0] );
85
- Tools.dom( 'stop', null, { offset:'60%', style:'stop-color:'+cc0[1]+'; stop-opacity:1;' }, svg, [1,0] );
86
- Tools.dom( 'stop', null, { offset:'80%', style:'stop-color:'+cc0[1]+'; stop-opacity:1;' }, svg, [1,0] );
87
- Tools.dom( 'stop', null, { offset:'100%', style:'stop-color:'+cc0[2]+'; stop-opacity:1;' }, svg, [1,0] );
88
-
89
- Tools.dom( 'radialGradient', null, {id:'gradIn2', cx:'50%', cy:'50%', r:'50%', fx:'50%', fy:'50%' }, this.c[4], 1 );
90
- Tools.dom( 'stop', null, { offset:'30%', style:'stop-color:'+cc1[0]+'; stop-opacity:1;' }, svg, [1,1] );
91
- Tools.dom( 'stop', null, { offset:'60%', style:'stop-color:'+cc1[1]+'; stop-opacity:1;' }, svg, [1,1] );
92
- Tools.dom( 'stop', null, { offset:'80%', style:'stop-color:'+cc1[1]+'; stop-opacity:1;' }, svg, [1,1] );
93
- Tools.dom( 'stop', null, { offset:'100%', style:'stop-color:'+cc1[2]+'; stop-opacity:1;' }, svg, [1,1] );
94
-
95
- //console.log( this.c[4] )
96
-
97
- this.c[5].textContent = 'x'+ this.value[0] +' y' + this.value[1];
98
-
99
- this.c[2].events = [ 'mouseover', 'mousedown', 'mouseout' ];
100
-
101
- this.init();
102
-
103
- this.update(false);
104
- }
105
-
106
- Joystick.prototype = Object.create( Proto.prototype );
107
- Joystick.prototype.constructor = Joystick;
108
-
109
- Joystick.prototype.handleEvent = function( e ) {
110
-
111
- e.preventDefault();
112
-
113
- switch( e.type ) {
114
- case 'mouseover': this.over( e ); break;
115
- case 'mousedown': this.down( e ); break;
116
- case 'mouseout': this.out( e ); break;
117
- case 'mouseup': this.up( e ); break;
118
- case 'mousemove': this.move( e ); break;
119
- }
120
-
121
- };
122
-
123
- Joystick.prototype.mode = function( mode ){
124
-
125
- switch(mode){
126
- case 0: // base
127
- Tools.setSvg( this.c[4], 'fill','url(#gradIn)');
128
- Tools.setSvg( this.c[4], 'stroke', '#000' );
129
- break;
130
- case 1: // over
131
- Tools.setSvg( this.c[4], 'fill', 'url(#gradIn2)' );
132
- Tools.setSvg( this.c[4], 'stroke', 'rgba(0,0,0,0)' );
133
- break;
134
- case 2: // edit
135
- break;
136
-
137
- }
138
- }
139
-
140
- Joystick.prototype.over = function( e ){
141
-
142
- this.isOver = true;
143
- this.mode(1);
144
-
145
- };
146
-
147
- Joystick.prototype.out = function( e ){
148
-
149
- this.isOver = false;
150
- if(this.isDown) return;
151
- this.mode(0);
152
-
153
- };
154
-
155
- Joystick.prototype.up = function( e ){
156
-
157
- this.isDown = false;
158
- document.removeEventListener( 'mouseup', this, false );
159
- document.removeEventListener( 'mousemove', this, false );
160
-
161
- this.interval = setInterval(this.update.bind(this), 10);
162
-
163
- if(this.isOver) this.mode(1);
164
- else this.mode(0);
165
-
166
- };
167
-
168
- Joystick.prototype.down = function( e ){
169
-
170
- this.isDown = true;
171
- document.addEventListener( 'mouseup', this, false );
172
- document.addEventListener( 'mousemove', this, false );
173
-
174
- this.rect = this.c[2].getBoundingClientRect();
175
- this.move( e );
176
- this.mode( 2 );
177
-
178
- };
179
-
180
- Joystick.prototype.move = function( e ){
181
-
182
- if( !this.isDown ) return;
183
-
184
- var x = this.radius - ( e.clientX - this.rect.left );
185
- var y = this.radius - ( e.clientY - this.rect.top );
186
-
187
- var distance = Math.sqrt( x * x + y * y );
188
-
189
- if ( distance > this.maxDistance ) {
190
- var angle = Math.atan2(x, y);
191
- x = Math.sin(angle) * this.maxDistance;
192
- y = Math.cos(angle) * this.maxDistance;
193
- }
194
-
195
- this.x = x / this.maxDistance;
196
- this.y = y / this.maxDistance;
197
-
198
- this.update();
199
-
200
- };
201
-
202
- Joystick.prototype.setValue = function( x, y ){
203
-
204
- this.x = x || 0;
205
- this.y = y || 0;
206
-
207
- this.updateSVG();
208
-
209
- };
210
-
211
- Joystick.prototype.update = function( up ){
212
-
213
- if(up === undefined) up = true;
214
-
215
- if( this.interval !== null ){
216
-
217
- if( !this.isDown ){
218
- this.x += (0 - this.x)/3;
219
- this.y += (0 - this.y)/3;
220
- }
221
-
222
- if ( this.x.toFixed(2) === this.oldx.toFixed(2) && this.y.toFixed(2) === this.oldy.toFixed(2)){
223
-
224
- this.x = 0;
225
- this.y = 0;
226
- }
227
-
228
- }
229
-
230
- this.updateSVG();
231
-
232
- if( up ) this.send();
233
-
234
- if( this.interval !== null && this.x === 0 && this.y === 0 ){
235
- clearInterval( this.interval );
236
- this.interval = null;
237
- }
238
-
239
- };
240
-
241
- Joystick.prototype.updateSVG = function(){
242
-
243
- var rx = this.x * this.maxDistance;
244
- var ry = this.y * this.maxDistance;
245
- var x = this.radius - rx;
246
- var y = this.radius - ry;
247
- var sx = x + ((1-this.x)*5) + 5;
248
- var sy = y + ((1-this.y)*5) + 10;
249
-
250
- Tools.setSvg( this.c[3], 'cx', sx );
251
- Tools.setSvg( this.c[3], 'cy', sy );
252
- Tools.setSvg( this.c[4], 'cx', x );
253
- Tools.setSvg( this.c[4], 'cy', y );
254
-
255
- this.oldx = this.x;
256
- this.oldy = this.y;
257
-
258
- this.value[0] = -( this.x * this.multiplicator ).toFixed( this.precision ) * 1;
259
- this.value[1] = ( this.y * this.multiplicator ).toFixed( this.precision ) * 1;
260
-
261
- this.c[5].textContent = 'x'+ this.value[0] +' y' + this.value[1];
262
-
263
- };
264
-
265
- export { Joystick };
package/src/proto/Knob.js DELETED
@@ -1,141 +0,0 @@
1
- import { Tools } from '../core/Tools';
2
- import { Proto } from '../core/Proto';
3
- import { Circular } from './Circular';
4
-
5
- function Knob ( o ) {
6
-
7
- Proto.call( this, o );
8
-
9
- //this.type = 'knob';
10
- this.autoWidth = false;
11
-
12
- this.buttonColor = Tools.colors.button;
13
-
14
- this.setTypeNumber( o );
15
-
16
- this.mPI = Math.PI * 0.8;
17
- this.toDeg = 180 / Math.PI;
18
- this.cirRange = this.mPI * 2;
19
-
20
- this.radius = o.radius || 15;
21
-
22
- this.width = (this.radius*2)+20;
23
-
24
- if(o.width !== undefined){
25
- this.width = o.width;
26
- this.radius = ~~ (this.width-20)*0.5;
27
- }
28
-
29
- if(o.size !== undefined){
30
- this.width = o.size;
31
- this.radius = ~~ (this.width-20)*0.5;
32
- }
33
-
34
- this.w = this.height = this.radius * 2;
35
- this.h = o.height || (this.height + 40);
36
- this.top = 0;
37
-
38
- this.c[0].style.width = this.width +'px';
39
-
40
- if(this.c[1] !== undefined) {
41
-
42
- this.c[1].style.width = this.width +'px';
43
- this.c[1].style.textAlign = 'center';
44
- this.top = 20;
45
-
46
- }
47
-
48
- this.percent = 0;
49
-
50
- this.c[2] = Tools.dom( 'div', Tools.css.txtnumber + 'text-align:center; top:'+(this.height+24)+'px; width:'+this.width+'px; color:'+ this.fontColor );
51
-
52
- this.c[3] = Tools.dom( 'circle', Tools.css.basic + 'left:10px; top:'+this.top+'px; width:'+this.w+'px; height:'+this.height+'px; pointer-events:auto; cursor:pointer;', { cx:this.radius, cy:this.radius, r:this.radius-4, fill:'rgba(0,0,0,0.3)' });
53
- this.c[4] = Tools.dom( 'circle', Tools.css.basic + 'left:10px; top:'+this.top+'px; width:'+this.w+'px; height:'+this.height+'px;', { cx:this.radius, cy:this.radius*0.5, r:3, fill:this.fontColor });
54
- this.c[5] = Tools.dom( 'path', Tools.css.basic + 'left:10px; top:'+this.top+'px; width:'+this.w+'px; height:'+this.height+'px;', { d:this.makeGrad(), 'stroke-width':1, stroke:Tools.colors.stroke });
55
-
56
- Tools.dom( 'circle', null, { cx:this.radius, cy:this.radius, r:this.radius*0.7, fill:this.buttonColor, 'stroke-width':1, stroke:Tools.colors.stroke }, this.c[3] );
57
-
58
- this.c[3].events = [ 'mouseover', 'mousedown', 'mouseout' ];
59
-
60
- this.r = 0;
61
-
62
- this.init();
63
-
64
- this.update();
65
-
66
- };
67
-
68
- Knob.prototype = Object.create( Circular.prototype );
69
- Knob.prototype.constructor = Knob;
70
-
71
- Knob.prototype.move = function( e ){
72
-
73
- if( !this.isDown ) return;
74
-
75
- var x = this.radius - (e.clientX - this.rect.left);
76
- var y = this.radius - (e.clientY - this.rect.top);
77
- this.r = - Math.atan2( x, y );
78
-
79
- if( this.oldr !== null ) this.r = Math.abs(this.r - this.oldr) > Math.PI ? this.oldr : this.r;
80
-
81
- this.r = this.r > this.mPI ? this.mPI : this.r;
82
- this.r = this.r < -this.mPI ? -this.mPI : this.r;
83
-
84
- var steps = 1 / this.cirRange;
85
- var value = (this.r + this.mPI) * steps;
86
-
87
- var n = ( ( this.range * value ) + this.min ) - this.old;
88
-
89
- if(n >= this.step || n <= this.step){
90
- n = ~~ ( n / this.step );
91
- this.value = this.numValue( this.old + ( n * this.step ) );
92
- this.update( true );
93
- this.old = this.value;
94
- this.oldr = this.r;
95
- }
96
-
97
- };
98
-
99
- Knob.prototype.makeGrad = function(){
100
-
101
- var d = '', step, range, a, x, y, x2, y2, r = this.radius;
102
- var startangle = Math.PI + this.mPI;
103
- var endangle = Math.PI - this.mPI;
104
-
105
- if(this.step>5){
106
- range = this.range / this.step;
107
- step = ( startangle - endangle ) / range;
108
- } else {
109
- step = ( startangle - endangle ) / r;
110
- range = r;
111
- }
112
-
113
- for ( var i = 0; i <= range; ++i ) {
114
-
115
- a = startangle - ( step * i );
116
- x = r + Math.sin( a ) * r;
117
- y = r + Math.cos( a ) * r;
118
- x2 = r + Math.sin( a ) * ( r - 3 );
119
- y2 = r + Math.cos( a ) * ( r - 3 );
120
- d += 'M' + x + ' ' + y + ' L' + x2 + ' '+y2 + ' ';
121
-
122
- }
123
-
124
- return d;
125
-
126
- };
127
-
128
- Knob.prototype.update = function( up ){
129
-
130
- this.c[2].textContent = this.value;
131
- this.percent = (this.value - this.min) / this.range;
132
-
133
- var r = ( (this.percent * this.cirRange) - (this.mPI)) * this.toDeg;
134
-
135
- Tools.setSvg( this.c[4], 'transform', 'rotate('+ r +' '+this.radius+' '+this.radius+')' );
136
-
137
- if( up ) this.send();
138
-
139
- };
140
-
141
- export { Knob };