uil 4.0.0 → 4.0.4

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.
Files changed (46) hide show
  1. package/README.md +5 -1
  2. package/build/uil.js +33 -45
  3. package/build/uil.min.js +1 -1
  4. package/build/uil.module.js +45 -58
  5. package/package.json +6 -10
  6. package/examples/js/BufferGeometryUtils.js +0 -921
  7. package/examples/js/SimplexNoise.js +0 -324
  8. package/examples/js/controls/OrbitControls.js +0 -1215
  9. package/examples/js/controls/OrbitControls_.js +0 -1042
  10. package/examples/js/libs/sea3d.min.js +0 -373
  11. package/examples/js/libs/three.min.js +0 -6
  12. package/examples/js/math.js +0 -447
  13. package/examples/js/objects/Landscape.js +0 -778
  14. package/examples/js/objects/Lensflare.js +0 -372
  15. package/examples/js/objects/SuperSky.js +0 -297
  16. package/examples/js/objects/Water.js +0 -329
  17. package/src/Uil.js +0 -6
  18. package/src/Uil_dev.js +0 -15
  19. package/src/core/Gui.js +0 -807
  20. package/src/core/Proto.js +0 -679
  21. package/src/core/Roots.js +0 -864
  22. package/src/core/Tools.js +0 -830
  23. package/src/core/V2.js +0 -131
  24. package/src/core/add.js +0 -85
  25. package/src/polyfills.js +0 -85
  26. package/src/proto/Bool.js +0 -147
  27. package/src/proto/Button.js +0 -357
  28. package/src/proto/Circular.js +0 -230
  29. package/src/proto/Color.js +0 -411
  30. package/src/proto/Empty.js +0 -15
  31. package/src/proto/Fps.js +0 -327
  32. package/src/proto/Graph.js +0 -310
  33. package/src/proto/Grid.js +0 -297
  34. package/src/proto/Group.js +0 -430
  35. package/src/proto/Item.js +0 -120
  36. package/src/proto/Joystick.js +0 -241
  37. package/src/proto/Knob.js +0 -262
  38. package/src/proto/List.js +0 -789
  39. package/src/proto/Numeric.js +0 -417
  40. package/src/proto/Pad2D.js +0 -268
  41. package/src/proto/Rubric.js +0 -0
  42. package/src/proto/Select.js +0 -178
  43. package/src/proto/Selector.js +0 -13
  44. package/src/proto/Slide.js +0 -267
  45. package/src/proto/TextInput.js +0 -181
  46. package/src/proto/Title.js +0 -61
package/src/core/Gui.js DELETED
@@ -1,807 +0,0 @@
1
-
2
- import { Roots } from './Roots.js';
3
- import { Tools } from './Tools.js';
4
- import { add } from './add.js';
5
- import { V2 } from './V2.js';
6
-
7
- /**
8
- * @author lth / https://github.com/lo-th
9
- */
10
-
11
- export class Gui {
12
-
13
- constructor( o = {} ) {
14
-
15
- this.isGui = true
16
-
17
- this.name = 'gui'
18
-
19
- // for 3d
20
- this.canvas = null
21
- this.screen = null
22
- this.plane = o.plane || null
23
-
24
- this.isEmpty = true
25
-
26
- // color
27
- if( o.config ) o.colors = o.config
28
-
29
- if ( o.colors ) this.setConfig( o.colors )
30
- else this.colors = Tools.defineColor( o )
31
-
32
- // style
33
- this.css = Tools.cloneCss()
34
-
35
- this.isReset = true
36
- this.tmpAdd = null
37
- //this.tmpH = 0
38
-
39
- this.isCanvas = o.isCanvas || false
40
- this.isCanvasOnly = false
41
-
42
- this.callback = o.callback === undefined ? null : o.callback
43
-
44
- this.forceHeight = o.maxHeight || 0
45
- this.lockHeight = o.lockHeight || false
46
-
47
- this.isItemMode = o.itemMode !== undefined ? o.itemMode : false
48
-
49
- this.cn = ''
50
-
51
- // size define
52
- this.size = Tools.size;
53
- if( o.p !== undefined ) this.size.p = o.p;
54
- if( o.w !== undefined ) this.size.w = o.w;
55
- if( o.h !== undefined ) this.size.h = o.h;
56
- if( o.s !== undefined ) this.size.s = o.s;
57
-
58
- this.size.h = this.size.h < 11 ? 11 : this.size.h;
59
-
60
- // local mouse and zone
61
- this.local = new V2().neg();
62
- this.zone = { x:0, y:0, w:this.size.w, h:0 };
63
-
64
- // virtual mouse
65
- this.mouse = new V2().neg();
66
-
67
- this.h = 0;
68
- //this.prevY = -1;
69
- this.sw = 0;
70
-
71
-
72
-
73
- // bottom and close height
74
- this.isWithClose = o.close !== undefined ? o.close : true;
75
- this.bh = !this.isWithClose ? 0 : this.size.h;
76
-
77
- this.autoResize = o.autoResize === undefined ? true : o.autoResize;
78
-
79
- // default position
80
- this.isCenter = o.center || false
81
- this.cssGui = o.css !== undefined ? o.css : (this.isCenter ? '' : 'right:10px;')
82
-
83
- this.isOpen = o.open !== undefined ? o.open : true;
84
- this.isDown = false;
85
- this.isScroll = false;
86
-
87
- this.uis = [];
88
-
89
- this.current = -1;
90
- this.target = null;
91
- this.decal = 0;
92
- this.ratio = 1;
93
- this.oy = 0;
94
-
95
-
96
- this.isNewTarget = false;
97
-
98
- let cc = this.colors
99
-
100
- this.content = Tools.dom( 'div', this.css.basic + ' width:0px; height:auto; top:0px; background:'+cc.content+'; ' + this.cssGui );
101
-
102
- this.innerContent = Tools.dom( 'div', this.css.basic + 'width:100%; top:0; left:0; height:auto; overflow:hidden;');
103
- //this.innerContent = Tools.dom( 'div', this.css.basic + this.css.button + 'width:100%; top:0; left:0; height:auto; overflow:hidden;');
104
- this.content.appendChild( this.innerContent );
105
-
106
- //this.inner = Tools.dom( 'div', this.css.basic + 'width:100%; left:0; ')
107
- this.useFlex = true
108
- let flexible = this.useFlex ? 'display:flex; flex-flow: row wrap;' : '' //' display:flex; justify-content:start; align-items:start;flex-direction: column; justify-content: center; align-items: center;';
109
- this.inner = Tools.dom( 'div', this.css.basic + flexible + 'width:100%; left:0; ');
110
- this.innerContent.appendChild(this.inner);
111
-
112
- // scroll
113
- this.scrollBG = Tools.dom( 'div', this.css.basic + 'right:0; top:0; width:'+ (this.size.s - 1) +'px; height:10px; display:none; background:'+cc.background+';');
114
- this.content.appendChild( this.scrollBG );
115
-
116
- this.scroll = Tools.dom( 'div', this.css.basic + 'background:'+cc.button+'; right:2px; top:0; width:'+(this.size.s-4)+'px; height:10px;');
117
- this.scrollBG.appendChild( this.scroll );
118
-
119
- // bottom button
120
- this.bottomText = o.bottomText || ['open', 'close'];
121
-
122
- let r = cc.radius;
123
- this.bottom = Tools.dom( 'div', this.css.txt + 'width:100%; top:auto; bottom:0; left:0; border-bottom-right-radius:'+r+'px; border-bottom-left-radius:'+r+'px; justify-content:center; height:'+this.bh+'px; line-height:'+(this.bh-5)+'px; color:' + cc.text+';' );// border-top:1px solid '+Tools.colors.stroke+';');
124
- this.content.appendChild( this.bottom )
125
- this.bottom.textContent = this.isOpen ? this.bottomText[1] : this.bottomText[0]
126
- this.bottom.style.background = cc.background
127
-
128
- //
129
-
130
- this.parent = o.parent !== undefined ? o.parent : null;
131
- this.parent = o.target !== undefined ? o.target : this.parent;
132
-
133
- if( this.parent === null && !this.isCanvas ){
134
- this.parent = document.body
135
- }
136
-
137
- if( this.parent !== null ) this.parent.appendChild( this.content );
138
-
139
- if( this.isCanvas && this.parent === null ) this.isCanvasOnly = true;
140
-
141
- if( !this.isCanvasOnly ){
142
- this.content.style.pointerEvents = 'auto';
143
- } else {
144
- o.transition = 0
145
- }
146
-
147
-
148
- // height transition
149
- this.transition = o.transition || Tools.transition
150
- if( this.transition ) setTimeout( this.addTransition.bind( this ), 0 );
151
-
152
-
153
- this.setWidth();
154
-
155
- if( this.isCanvas ) this.makeCanvas();
156
-
157
- Roots.add( this );
158
-
159
- }
160
-
161
- setTop( t, h ) {
162
-
163
- this.content.style.top = t + 'px';
164
- if( h !== undefined ) this.forceHeight = h;
165
- this.calc();
166
-
167
- Roots.needReZone = true;
168
-
169
- }
170
-
171
- addTransition(){
172
-
173
- if( this.transition && !this.isCanvas ){
174
- this.innerContent.style.transition = 'height '+this.transition+'s ease-out';
175
- this.content.style.transition = 'height '+this.transition+'s ease-out';
176
- this.bottom.style.transition = 'top '+this.transition+'s ease-out';
177
- //this.bottom.addEventListener("transitionend", Roots.resize, true);
178
- }
179
-
180
- }
181
-
182
- // ----------------------
183
- // CANVAS
184
- // ----------------------
185
-
186
- onDraw () {}
187
-
188
- makeCanvas () {
189
-
190
- this.canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', "canvas" );
191
- this.canvas.width = this.zone.w;
192
- this.canvas.height = this.forceHeight ? this.forceHeight : this.zone.h;
193
-
194
- }
195
-
196
- draw ( force ) {
197
-
198
- if( this.canvas === null ) return;
199
-
200
- let w = this.zone.w;
201
- let h = this.forceHeight ? this.forceHeight : this.zone.h;
202
- Roots.toCanvas( this, w, h, force );
203
-
204
- }
205
-
206
- //////
207
-
208
- getDom () {
209
-
210
- return this.content;
211
-
212
- }
213
-
214
- noMouse () {
215
-
216
- this.mouse.neg();
217
-
218
- }
219
-
220
- setMouse ( uv, flip = true ) {
221
-
222
- if(flip) this.mouse.set( Math.round( uv.x * this.canvas.width ), this.canvas.height - Math.round( uv.y * this.canvas.height ) );
223
- else this.mouse.set( Math.round( uv.x * this.canvas.width ), Math.round( uv.y * this.canvas.height ) );
224
- //this.mouse.set( m.x, m.y );
225
-
226
- }
227
-
228
- setConfig ( o ) {
229
-
230
- // reset to default text
231
- Tools.setText()
232
- this.colors = Tools.defineColor( o )
233
-
234
- }
235
-
236
- setColors ( o ) {
237
-
238
- for( let c in o ){
239
- if( this.colors[c] ) this.colors[c] = o[c];
240
- }
241
-
242
- }
243
-
244
- setText ( size, color, font, shadow ) {
245
-
246
- Tools.setText( size, color, font, shadow );
247
-
248
- }
249
-
250
- hide ( b ) {
251
-
252
- this.content.style.display = b ? 'none' : 'block';
253
-
254
- }
255
-
256
- onChange ( f ) {
257
-
258
- this.callback = f || null;
259
- return this;
260
-
261
- }
262
-
263
- // ----------------------
264
- // STYLES
265
- // ----------------------
266
-
267
- mode ( n ) {
268
-
269
- let needChange = false;
270
- let cc = this.colors;
271
-
272
- if( n !== this.cn ){
273
-
274
- this.cn = n;
275
-
276
- switch( n ){
277
-
278
- case 'def':
279
- Roots.cursor();
280
- this.scroll.style.background = cc.button;
281
- this.bottom.style.background = cc.background
282
- this.bottom.style.color = cc.text
283
- break;
284
-
285
- //case 'scrollDef': this.scroll.style.background = this.colors.scroll; break;
286
- case 'scrollOver':
287
- Roots.cursor('ns-resize');
288
- this.scroll.style.background = cc.select
289
- break;
290
- case 'scrollDown':
291
- this.scroll.style.background = cc.select
292
- break;
293
-
294
- //case 'bottomDef': this.bottom.style.background = this.colors.background; break;
295
- case 'bottomOver':
296
- Roots.cursor('pointer');
297
- this.bottom.style.background = cc.backgroundOver;
298
- this.bottom.style.color = cc.textOver;
299
- break;
300
- //case 'bottomDown': this.bottom.style.background = this.colors.select; this.bottom.style.color = '#000'; break;
301
-
302
- }
303
-
304
- needChange = true;
305
-
306
- }
307
-
308
- return needChange;
309
-
310
- }
311
-
312
- // ----------------------
313
- // TARGET
314
- // ----------------------
315
-
316
- clearTarget () {
317
-
318
- if( this.current === -1 ) return false;
319
- //if(!this.target) return;
320
- this.target.uiout();
321
- this.target.reset();
322
- this.target = null;
323
- this.current = -1;
324
-
325
- ///console.log(this.isDown)//if(this.isDown)Roots.clearInput();
326
-
327
-
328
-
329
- Roots.cursor();
330
- return true;
331
-
332
- }
333
-
334
- // ----------------------
335
- // ZONE TEST
336
- // ----------------------
337
-
338
- testZone ( e ) {
339
-
340
- let l = this.local;
341
- if( l.x === -1 && l.y === -1 ) return '';
342
-
343
- this.isReset = false;
344
-
345
- let name = '';
346
-
347
- let s = this.isScroll ? this.zone.w - this.size.s : this.zone.w;
348
-
349
- if( l.y > this.zone.h - this.bh && l.y < this.zone.h ) name = 'bottom';
350
- else name = l.x > s ? 'scroll' : 'content';
351
-
352
- return name;
353
-
354
- }
355
-
356
- // ----------------------
357
- // EVENTS
358
- // ----------------------
359
-
360
- handleEvent ( e ) {
361
-
362
- let type = e.type;
363
-
364
- let change = false;
365
- let targetChange = false;
366
-
367
- let name = this.testZone( e );
368
-
369
- if( type === 'mouseup' && this.isDown ) this.isDown = false;
370
- if( type === 'mousedown' && !this.isDown ) this.isDown = true;
371
-
372
- if( this.isDown && this.isNewTarget ){ Roots.clearInput(); this.isNewTarget=false; }
373
-
374
- if( !name ) return;
375
-
376
- switch( name ){
377
-
378
- case 'content':
379
-
380
- e.clientY = this.isScroll ? e.clientY + this.decal : e.clientY;
381
-
382
- if( Roots.isMobile && type === 'mousedown' ) this.getNext( e, change );
383
-
384
- if( this.target ) targetChange = this.target.handleEvent( e );
385
-
386
- if( type === 'mousemove' ) change = this.mode('def');
387
- if( type === 'wheel' && !targetChange && this.isScroll ) change = this.onWheel( e );
388
-
389
- if( !Roots.lock ) {
390
- this.getNext( e, change );
391
- }
392
-
393
- break;
394
- case 'bottom':
395
-
396
- this.clearTarget();
397
- if( type === 'mousemove' ) change = this.mode('bottomOver');
398
- if( type === 'mousedown' ) {
399
- this.isOpen = this.isOpen ? false : true;
400
- this.bottom.textContent = this.isOpen ? this.bottomText[1] : this.bottomText[0];
401
- //this.setHeight();
402
- this.calc();
403
- this.mode('def');
404
- change = true;
405
- }
406
-
407
- break;
408
- case 'scroll':
409
-
410
- this.clearTarget();
411
- if( type === 'mousemove' ) change = this.mode('scrollOver');
412
- if( type === 'mousedown' ) change = this.mode('scrollDown');
413
- if( type === 'wheel' ) change = this.onWheel( e );
414
- if( this.isDown ) this.update( (e.clientY-this.zone.y)-(this.sh*0.5) );
415
-
416
- break;
417
-
418
-
419
- }
420
-
421
- if( this.isDown ) change = true;
422
- if( targetChange ) change = true;
423
-
424
- if( type === 'keyup' ) change = true;
425
- if( type === 'keydown' ) change = true;
426
-
427
- if( change ) this.draw();
428
-
429
- }
430
-
431
- getNext ( e, change ) {
432
-
433
-
434
-
435
- let next = Roots.findTarget( this.uis, e );
436
-
437
- if( next !== this.current ){
438
- this.clearTarget();
439
- this.current = next;
440
- change = true;
441
-
442
- this.isNewTarget = true;
443
-
444
- }
445
-
446
- if( next !== -1 ){
447
- this.target = this.uis[ this.current ];
448
- this.target.uiover();
449
- }
450
-
451
- }
452
-
453
- onWheel ( e ) {
454
-
455
- this.oy += 20*e.delta;
456
- this.update( this.oy );
457
- return true;
458
-
459
- }
460
-
461
- // ----------------------
462
- // RESET
463
- // ----------------------
464
-
465
- reset ( force ) {
466
-
467
- if( this.isReset ) return;
468
-
469
- //this.resetItem();
470
-
471
- this.mouse.neg();
472
- this.isDown = false;
473
-
474
- //Roots.clearInput();
475
- let r = this.mode('def');
476
- let r2 = this.clearTarget();
477
-
478
- if( r || r2 ) this.draw( true );
479
-
480
- this.isReset = true;
481
-
482
- //Roots.lock = false;
483
-
484
- }
485
-
486
- // ----------------------
487
- // ADD NODE
488
- // ----------------------
489
-
490
- add () {
491
-
492
- let a = arguments
493
- let ontop = false
494
-
495
- if( typeof a[1] === 'object' ){
496
-
497
- a[1].isUI = true;
498
- a[1].main = this;
499
-
500
- ontop = a[1].ontop ? a[1].ontop : false;
501
-
502
- } else if( typeof a[1] === 'string' ){
503
-
504
- if( a[2] === undefined ) [].push.call(a, { isUI:true, main:this });
505
- else {
506
- a[2].isUI = true;
507
- a[2].main = this;
508
-
509
- ontop = a[1].ontop ? a[1].ontop : false;
510
- }
511
-
512
- }
513
-
514
- let u = add.apply( this, a )
515
-
516
- if( u === null ) return;
517
-
518
- if( ontop ) this.uis.unshift( u )
519
- else this.uis.push( u )
520
-
521
- /*if( !u.autoWidth ){
522
- let y = u.c[0].getBoundingClientRect().top;
523
- if( this.prevY !== y ){
524
- this.calc( u.h + 1 );
525
- this.prevY = y;
526
- }
527
- }else{
528
- this.prevY = 0;//-1;
529
- this.calc( u.h + 1 );
530
- }*/
531
-
532
- this.calc()
533
-
534
- this.isEmpty = false
535
-
536
- return u
537
-
538
- }
539
-
540
- /*applyCalc () {
541
-
542
- //console.log(this.uis.length, this.tmpH )
543
-
544
- this.calc( this.tmpH );
545
- //this.tmpH = 0;
546
- this.tmpAdd = null;
547
-
548
- }*/
549
-
550
-
551
-
552
- // remove one node
553
-
554
- remove ( n ) {
555
-
556
- if( n.clear ) n.clear();
557
-
558
- }
559
-
560
- // call after uis clear
561
-
562
- clearOne ( n ) {
563
-
564
- let id = this.uis.indexOf( n );
565
- if ( id !== -1 ) {
566
- //this.calc( - (this.uis[ id ].h + 1 ) );
567
- this.inner.removeChild( this.uis[ id ].c[0] );
568
- this.uis.splice( id, 1 );
569
- this.calc()
570
- }
571
-
572
- }
573
-
574
- // clear all gui
575
-
576
- empty() {
577
-
578
- //this.close();
579
-
580
- let i = this.uis.length, item;
581
-
582
- while( i-- ){
583
- item = this.uis.pop();
584
- this.inner.removeChild( item.c[0] );
585
- item.clear( true );
586
-
587
- //this.uis[i].clear()
588
- }
589
-
590
- this.uis = [];
591
- this.isEmpty = true;
592
- //this.zone = { x:0, y:0, w:this.size.w, h:0 };
593
- //this.setWidth()
594
- //Roots.listens = [];
595
- this.calc();
596
-
597
-
598
-
599
- }
600
-
601
- clear() {
602
-
603
- this.empty();
604
-
605
- //this.callback = null;
606
-
607
- /*let i = this.uis.length;
608
- while( i-- ) this.uis[i].clear();
609
-
610
- this.uis = [];
611
- Roots.listens = [];
612
-
613
- this.calc( -this.h );*/
614
-
615
- }
616
-
617
- dispose() {
618
-
619
- this.clear();
620
- if( this.parent !== null ) this.parent.removeChild( this.content );
621
- Roots.remove( this );
622
-
623
- }
624
-
625
- // ----------------------
626
- // ITEMS SPECIAL
627
- // ----------------------
628
-
629
-
630
- resetItem () {
631
-
632
- if( !this.isItemMode ) return;
633
-
634
- let i = this.uis.length;
635
- while(i--) this.uis[i].selected();
636
-
637
- }
638
-
639
- setItem ( name ) {
640
-
641
- if( !this.isItemMode ) return;
642
-
643
- name = name || '';
644
-
645
- this.resetItem();
646
-
647
- if( !name ){
648
- this.update(0);
649
- return;
650
- }
651
-
652
- let i = this.uis.length;
653
- while(i--){
654
- if( this.uis[i].value === name ){
655
- this.uis[i].selected( true );
656
- if( this.isScroll ) this.update( ( i*(this.uis[i].h+1) )*this.ratio );
657
- }
658
- }
659
-
660
- }
661
-
662
-
663
-
664
- // ----------------------
665
- // SCROLL
666
- // ----------------------
667
-
668
- upScroll ( b ) {
669
-
670
- this.sw = b ? this.size.s : 0;
671
- this.oy = b ? this.oy : 0;
672
- this.scrollBG.style.display = b ? 'block' : 'none';
673
-
674
- if( b ){
675
-
676
- this.total = this.h;
677
-
678
- this.maxView = this.maxHeight;
679
-
680
- this.ratio = this.maxView / this.total;
681
- this.sh = this.maxView * this.ratio;
682
-
683
- //if( this.sh < 20 ) this.sh = 20;
684
-
685
- this.range = this.maxView - this.sh;
686
-
687
- this.oy = Tools.clamp( this.oy, 0, this.range );
688
-
689
- this.scrollBG.style.height = this.maxView + 'px';
690
- this.scroll.style.height = this.sh + 'px';
691
-
692
- }
693
-
694
- this.setItemWidth( this.zone.w - this.sw );
695
- this.update( this.oy );
696
-
697
- }
698
-
699
- update ( y ) {
700
-
701
- y = Tools.clamp( y, 0, this.range );
702
-
703
- this.decal = Math.floor( y / this.ratio );
704
- this.inner.style.top = - this.decal + 'px';
705
- this.scroll.style.top = Math.floor( y ) + 'px';
706
- this.oy = y;
707
-
708
- }
709
-
710
- // ----------------------
711
- // RESIZE FUNCTION
712
- // ----------------------
713
-
714
- calcUis() {
715
-
716
- return Roots.calcUis( this.uis, this.zone, this.zone.y )
717
- }
718
-
719
- calc() {
720
-
721
- clearTimeout( this.tmp )
722
- this.tmp = setTimeout( this.setHeight.bind( this ), 10 )
723
-
724
- }
725
-
726
- setHeight() {
727
-
728
- if( this.tmp ) clearTimeout( this.tmp )
729
-
730
- this.zone.h = this.bh
731
- this.isScroll = false
732
-
733
- if( this.isOpen ){
734
-
735
- this.h = this.calcUis()
736
-
737
- let hhh = this.forceHeight ? this.forceHeight + this.zone.y : window.innerHeight;
738
-
739
- this.maxHeight = hhh - this.zone.y - this.bh;
740
-
741
- let diff = this.h - this.maxHeight;
742
-
743
- if( diff > 1 ){ //this.h > this.maxHeight ){
744
-
745
- this.isScroll = true;
746
- this.zone.h = this.maxHeight + this.bh;
747
-
748
- } else {
749
-
750
- this.zone.h = this.h + this.bh;
751
-
752
- }
753
-
754
- }
755
-
756
- this.upScroll( this.isScroll )
757
-
758
- this.innerContent.style.height = this.zone.h - this.bh + 'px'
759
- this.content.style.height = this.zone.h + 'px'
760
- this.bottom.style.top = this.zone.h - this.bh + 'px'
761
-
762
-
763
- if( this.forceHeight && this.lockHeight ) this.content.style.height = this.forceHeight + 'px';
764
-
765
- //if( this.isOpen ) this.calcUis()
766
- if( this.isCanvas ) this.draw( true )
767
- //else if( !this.transition ) this.rezone()
768
-
769
- }
770
-
771
- rezone () {
772
- Roots.needReZone = true;
773
- }
774
-
775
- setWidth ( w ) {
776
-
777
- if( w ) this.zone.w = w;
778
-
779
- this.zone.w = Math.floor( this.zone.w )
780
-
781
- //console.log( this.zone.w )
782
-
783
- this.content.style.width = this.zone.w + 'px';
784
-
785
- if( this.isCenter ) this.content.style.marginLeft = -(Math.floor(this.zone.w*0.5)) + 'px';
786
-
787
- this.setItemWidth( this.zone.w - this.sw );
788
-
789
- //this.setHeight();
790
- //this.calc()
791
-
792
- //if( this.isCanvasOnly ) Roots.needReZone = true;
793
- //Roots.resize();
794
-
795
- }
796
-
797
- setItemWidth ( w ) {
798
-
799
- let i = this.uis.length;
800
- while(i--){
801
- this.uis[i].setSize( w )
802
- this.uis[i].rSize()
803
- }
804
-
805
- }
806
-
807
- }