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