uil 4.2.3 → 4.2.5

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.
@@ -250,7 +250,7 @@ const R = {
250
250
  e.type = 'mouseup';
251
251
  }
252
252
 
253
- if( event.type === 'pointerleave'){ R.isLeave = true; }
253
+ if( event.type === 'pointerleave') R.isLeave = true;
254
254
 
255
255
  if( event.type === 'pointerdown') e.type = 'mousedown';
256
256
  if( event.type === 'pointerup') e.type = 'mouseup';
@@ -301,6 +301,8 @@ const R = {
301
301
 
302
302
  }
303
303
 
304
+ //if( R.ID.marginDiv ) e.clientY -= R.ID.margin * 0.5
305
+
304
306
  R.ID.handleEvent( e );
305
307
 
306
308
  }
@@ -367,13 +369,13 @@ const R = {
367
369
  // GUI / GROUP FUNCTION
368
370
  // ----------------------
369
371
 
370
- calcUis: function ( uis, zone, py ) {
372
+ calcUis: ( uis, zone, py ) => {
371
373
 
372
374
  //console.log('calc_uis')
373
375
 
374
- let i = uis.length, u, px = 0, n = 0, tw;
376
+ let i = uis.length, u, px = 0, n = 0, tw, m;
377
+
375
378
  let height = 0;
376
- let m = 1;
377
379
 
378
380
  while( i-- ){
379
381
 
@@ -382,33 +384,30 @@ const R = {
382
384
 
383
385
  if( u.isGroup ) u.calcUis();
384
386
 
385
- u.zone.w = u.w;
386
- u.zone.h = u.h;
387
387
  m = u.margin;
388
+ //div = u.marginDiv
388
389
 
390
+ u.zone.w = u.w;
391
+ u.zone.h = u.h + m;
392
+
389
393
  if( !u.autoWidth ){
390
394
 
391
- if( px===0 ){
392
- height += u.h + m;
393
-
394
- }
395
+ if( px === 0 ) height += u.h + m;
395
396
 
396
397
  u.zone.x = zone.x + px;
397
- u.zone.y = py;
398
+ u.zone.y = py;// + u.mtop
399
+ //if(div) u.zone.y += m * 0.5
398
400
 
399
401
  tw = R.getWidth(u);
400
402
  if( tw ) u.zone.w = u.w = tw;
401
- // focrce width if content is canvas
402
403
  else if( u.fw ) u.zone.w = u.w = u.fw;
403
404
 
404
-
405
- //console.log( u.name, u.zone.w, u.w, zone, tw )
406
- //console.log( tw )
407
405
  px += u.zone.w;
408
406
 
409
407
  if( px >= zone.w ) {
410
- py += u.h + m;
411
- px = 0;
408
+ py += u.h + m;
409
+ //if(div) py += m * 0.5
410
+ px = 0;
412
411
  }
413
412
 
414
413
  } else {
@@ -419,6 +418,7 @@ const R = {
419
418
  u.zone.y = py;
420
419
  py += u.h + m;
421
420
 
421
+
422
422
  height += u.h + m;
423
423
 
424
424
  }
@@ -472,8 +472,13 @@ const R = {
472
472
  let mx = x - z.x;
473
473
  let my = y - z.y;
474
474
 
475
+ //if( this.marginDiv ) e.clientY -= this.margin * 0.5
476
+ //if( o.group && o.group.marginDiv ) my += o.group.margin * 0.5
477
+
475
478
  let over = ( mx >= 0 ) && ( my >= 0 ) && ( mx <= z.w ) && ( my <= z.h );
476
479
 
480
+ //if( o.marginDiv ) my -= o.margin * 0.5
481
+
477
482
  if( over ) o.local.set( mx, my );
478
483
  else o.local.neg();
479
484
 
@@ -910,7 +915,7 @@ const T = {
910
915
  torad: Math.PI / 180,
911
916
  todeg: 180 / Math.PI,
912
917
 
913
- clamp: function (v, min, max) {
918
+ clamp: ( v, min, max ) => {
914
919
 
915
920
  v = v < min ? min : v;
916
921
  v = v > max ? max : v;
@@ -918,13 +923,15 @@ const T = {
918
923
 
919
924
  },
920
925
 
926
+ isDivid: ( v ) => ( v*0.5 === Math.floor(v*0.5) ),
927
+
921
928
  size: { w: 240, h: 20, p: 30, s: 8 },
922
929
 
923
930
  // ----------------------
924
931
  // COLOR
925
932
  // ----------------------
926
933
 
927
- defineColor: function( o, cc = T.colors ) {
934
+ defineColor: ( o, cc = T.colors ) => {
928
935
 
929
936
  let color = { ...cc };
930
937
 
@@ -989,8 +996,9 @@ const T = {
989
996
 
990
997
  colors: {
991
998
 
992
- sx: 3,
993
- sy: 3,
999
+ sx: 4,//4
1000
+ sy: 2,//2
1001
+ radius:2,
994
1002
 
995
1003
  content:'none',
996
1004
  background: 'rgba(50,50,50,0.15)',
@@ -1025,7 +1033,7 @@ const T = {
1025
1033
  fontShadow: 'none',//'#000',
1026
1034
  fontSize:12,
1027
1035
 
1028
- radius:4,
1036
+
1029
1037
  hide: 'rgba(0,0,0,0)',
1030
1038
 
1031
1039
  },
@@ -1036,7 +1044,7 @@ const T = {
1036
1044
 
1037
1045
  basic: 'position:absolute; pointer-events:none; box-sizing:border-box; margin:0; padding:0; overflow:hidden; ' + '-o-user-select:none; -ms-user-select:none; -khtml-user-select:none; -webkit-user-select:none; -moz-user-select:none;',
1038
1046
  button:'display:flex; align-items:center; justify-content:center; text-align:center;',
1039
- middle:'display:flex; align-items:center; justify-content:left; text-align:left; flex-direction: row-reverse;'
1047
+ middle:'display:flex; align-items:center; justify-content:left; text-align:left; flex-direction: row-reverse;'
1040
1048
  },
1041
1049
 
1042
1050
  // svg path
@@ -1067,7 +1075,9 @@ const T = {
1067
1075
  object:'M 10 1 L 7 4 4 1 1 1 1 13 4 13 4 5 7 8 10 5 10 13 13 13 13 1 10 1 Z',
1068
1076
  none:'M 9 5 L 5 5 5 9 9 9 9 5 Z',
1069
1077
  cursor:'M 4 7 L 1 10 1 12 2 13 4 13 7 10 9 14 14 0 0 5 4 7 Z',
1070
- load:'M 14 8 L 12 8 12 12 2 12 2 8 0 8 0 14 14 14 14 8 M 8 5 L 8 0 6 0 6 5 3 5 7 9 11 5 8 5 Z',
1078
+ load:'M 13 8 L 11.5 6.5 9 9 9 3 5 3 5 9 2.5 6.5 1 8 7 14 13 8 M 9 2 L 9 0 5 0 5 2 9 2 Z',
1079
+ save:'M 9 12 L 5 12 5 14 9 14 9 12 M 11.5 7.5 L 13 6 7 0 1 6 2.5 7.5 5 5 5 11 9 11 9 5 11.5 7.5 Z',
1080
+ extern:'M 14 14 L 14 0 0 0 0 14 14 14 M 12 6 L 12 12 2 12 2 6 12 6 M 12 2 L 12 4 2 4 2 2 12 2 Z',
1071
1081
 
1072
1082
  },
1073
1083
 
@@ -1312,6 +1322,8 @@ const T = {
1312
1322
 
1313
1323
  ColorLuma : function ( hex, l ) {
1314
1324
 
1325
+ //if( hex.substring(0, 3) === 'rgba' ) hex = '#000';
1326
+
1315
1327
  if( hex === 'n' ) hex = '#000';
1316
1328
 
1317
1329
  // validate hex string
@@ -2140,6 +2152,9 @@ class Proto {
2140
2152
 
2141
2153
  this.isListen = false;
2142
2154
 
2155
+ this.top = 0;
2156
+ this.ytop = 0;
2157
+
2143
2158
  this.isSelectable = o.selectable !== undefined ? o.selectable : false;
2144
2159
  this.unselectable = o.unselect !== undefined ? o.unselect : this.isSelectable;
2145
2160
 
@@ -2151,7 +2166,7 @@ class Proto {
2151
2166
 
2152
2167
  this.svgs = Tools.svgs;
2153
2168
 
2154
- this.zone = { x:0, y:0, w:0, h:0 };
2169
+ this.zone = { x:0, y:0, w:0, h:0, d:0 };
2155
2170
  this.local = new V2().neg();
2156
2171
 
2157
2172
  this.isCanvasOnly = false;
@@ -2243,18 +2258,21 @@ class Proto {
2243
2258
  this.s[0] = this.c[0].style;
2244
2259
 
2245
2260
  // bottom margin
2246
- this.margin = o.margin || 1;
2261
+ this.margin = this.colors.sy;
2262
+ this.mtop = 0;
2263
+ let marginDiv = Tools.isDivid( this.margin );
2264
+
2247
2265
  if( this.isUI && this.margin ){
2248
2266
  this.s[0].boxSizing = 'content-box';
2249
- //this.s[0].marginBottom = this.margin + 'px';
2250
- if( this.margin*0.5===Math.floor(this.margin*0.5) ){
2251
- this.s[0].borderTop = (this.margin*0.5) + 'px solid transparent';
2252
- this.s[0].borderBottom = (this.margin*0.5) + 'px solid transparent';
2267
+ if( marginDiv ){
2268
+ this.mtop = this.margin * 0.5;
2269
+ //this.s[0].borderTop = '${this.mtop}px solid transparent'
2270
+ //console.log(`${this.mtop}px solid transparent`)
2271
+ this.s[0].borderTop = this.mtop + 'px solid transparent';
2272
+ this.s[0].borderBottom = this.mtop + 'px solid transparent';
2253
2273
  } else {
2254
- //this.s[0].borderTop = (this.margin*0.5) + 'px solid transparent'
2255
2274
  this.s[0].borderBottom = this.margin + 'px solid transparent';
2256
2275
  }
2257
-
2258
2276
  }
2259
2277
 
2260
2278
  // with title
@@ -2287,7 +2305,9 @@ class Proto {
2287
2305
 
2288
2306
  init() {
2289
2307
 
2290
- this.zone.h = this.h;
2308
+ this.ytop = this.top + this.mtop;
2309
+
2310
+ this.zone.h = this.h + this.margin;
2291
2311
  this.zone.w = this.w;
2292
2312
 
2293
2313
  let s = this.s; // style cache
@@ -2310,8 +2330,6 @@ class Proto {
2310
2330
  s[1] = c[1].style;
2311
2331
  s[1].top = 1 + 'px';
2312
2332
  s[1].height = (this.h-2) + 'px';
2313
- //s[1].height = (this.h-4) + 'px';
2314
- // s[1].lineHeight = (this.h-8) + 'px';
2315
2333
  }
2316
2334
 
2317
2335
  let frag = Tools.frag;
@@ -2441,7 +2459,6 @@ class Proto {
2441
2459
  uiout() {
2442
2460
 
2443
2461
  if( this.lock ) return;
2444
-
2445
2462
  if(this.s) this.s[0].background = this.colors.background;
2446
2463
 
2447
2464
  }
@@ -2449,7 +2466,6 @@ class Proto {
2449
2466
  uiover() {
2450
2467
 
2451
2468
  if( this.lock ) return;
2452
-
2453
2469
  if(this.s) this.s[0].background = this.colors.backgroundOver;
2454
2470
 
2455
2471
  }
@@ -2655,6 +2671,7 @@ class Proto {
2655
2671
  case 3: s = 0.001; break;
2656
2672
  case 4: s = 0.0001; break;
2657
2673
  case 5: s = 0.00001; break;
2674
+ case 6: s = 0.000001; break;
2658
2675
  }
2659
2676
 
2660
2677
  this.step = o.step === undefined ? s : o.step;
@@ -2666,7 +2683,7 @@ class Proto {
2666
2683
  numValue( n ) {
2667
2684
 
2668
2685
  if( this.noNeg ) n = Math.abs( n );
2669
- return Math.min( this.max, Math.max( this.min, n ) ).toFixed( this.precision ) * 1;
2686
+ return Math.min( this.max, Math.max( this.min, n ) ).toFixed( this.precision ) * 1
2670
2687
 
2671
2688
  }
2672
2689
 
@@ -2678,11 +2695,17 @@ class Proto {
2678
2695
  handleEvent( e ) {
2679
2696
 
2680
2697
  if( this.lock ) return
2681
-
2682
2698
  if( this.neverlock ) Roots.lock = false;
2683
-
2684
2699
  if( !this[e.type] ) return console.error(e.type, 'this type of event no existe !')
2685
2700
 
2701
+
2702
+ // TODO !!!!
2703
+
2704
+ //if( this.marginDiv ) z.d -= this.margin * 0.5
2705
+
2706
+ //if( this.marginDiv ) e.clientY -= this.margin * 0.5
2707
+ //if( this.group && this.group.marginDiv ) e.clientY -= this.group.margin * 0.5
2708
+
2686
2709
  return this[e.type](e)
2687
2710
 
2688
2711
  }
@@ -2805,7 +2828,7 @@ class Bool extends Proto {
2805
2828
  } else {
2806
2829
  this.p = 0;
2807
2830
  if( this.c[1] !== undefined ) this.c[1].textContent = '';
2808
- this.c[2] = this.dom( 'div', this.css.txt + this.css.button + 'top:1px; background:'+cc.button+'; height:'+(this.h-2)+'px; border:1px solid '+cc.border+'; border-radius:'+this.radius+'px;' );
2831
+ this.c[2] = this.dom( 'div', this.css.txt + this.css.button + 'top:1px; background:'+cc.button+'; height:'+(this.h-2)+'px; border:'+cc.borderSize+'px solid '+cc.border+'; border-radius:'+this.radius+'px;' );
2809
2832
  }
2810
2833
 
2811
2834
  this.stat = -1;
@@ -2919,7 +2942,7 @@ class Bool extends Proto {
2919
2942
  s[3].left = w + 'px';
2920
2943
  } else {
2921
2944
  s[2].left = this.sa + 'px';
2922
- s[2].width = (this.w- 20) + 'px';
2945
+ s[2].width = this.sb + 'px';
2923
2946
  }
2924
2947
 
2925
2948
  }
@@ -2937,7 +2960,7 @@ class Button extends Proto {
2937
2960
  this.values = o.value || this.txt;
2938
2961
  if( o.values ) this.values = o.values;
2939
2962
 
2940
- if( !o.values && !o.value ) this.txt = '';
2963
+ if( !o.values && !o.value ) this.txt = '';
2941
2964
 
2942
2965
 
2943
2966
 
@@ -2975,14 +2998,14 @@ class Button extends Proto {
2975
2998
 
2976
2999
  }
2977
3000
 
2978
- if( !o.value && !o.values ){
2979
- if( this.c[1] !== undefined ) {
2980
- this.c[1].textContent = '';
2981
- //this.txt = ''
2982
- }
2983
- }
3001
+
2984
3002
  if( this.txt==='' ) this.p = 0;
2985
3003
 
3004
+ if( (!o.value && !o.values) || this.p === 0 ){
3005
+ if( this.c[1] !== undefined ) this.c[1].textContent = '';
3006
+ }
3007
+
3008
+
2986
3009
  this.init();
2987
3010
 
2988
3011
  }
@@ -2990,7 +3013,7 @@ class Button extends Proto {
2990
3013
  onOff() {
2991
3014
 
2992
3015
  this.on = !this.on;
2993
- this.label( this.on ? this.onName : this.txt );
3016
+ this.label( this.on ? this.onName : this.value );
2994
3017
 
2995
3018
  }
2996
3019
 
@@ -3095,10 +3118,10 @@ class Button extends Proto {
3095
3118
 
3096
3119
  switch( n ){
3097
3120
 
3098
- case 1: s[i].color = cc.text; s[i].background = cc.button; break;
3099
- case 2: s[i].color = cc.textOver; s[i].background = cc.overoff; break;
3100
- case 3: s[i].color = cc.textOver; s[i].background = cc.over; break;
3101
- case 4: s[i].color = cc.textSelect; s[i].background = cc.select; break;
3121
+ case 1: s[i].color = cc.text; s[i].background = cc.button; break
3122
+ case 2: s[i].color = cc.textOver; s[i].background = cc.overoff; break
3123
+ case 3: s[i].color = cc.textOver; s[i].background = cc.over; break
3124
+ case 4: s[i].color = cc.textSelect; s[i].background = cc.select; break
3102
3125
 
3103
3126
  }
3104
3127
 
@@ -3148,7 +3171,7 @@ class Button extends Proto {
3148
3171
  let i = this.lng;
3149
3172
  let sx = this.colors.sx; //this.space;
3150
3173
  //let size = Math.floor( ( w-(dc*(i-1)) ) / i );
3151
- let size = ( ( w-(sx*(i-1)) ) / i );
3174
+ let size = ( w-(sx*(i-1)) ) / i;
3152
3175
 
3153
3176
  if( this.bw ){
3154
3177
  size = this.bw < size ? this.bw : size;
@@ -3193,7 +3216,6 @@ class Circular extends Proto {
3193
3216
  this.offset = new V2();
3194
3217
 
3195
3218
  this.h = o.h || this.w + 10;
3196
- this.top = 0;
3197
3219
 
3198
3220
  this.c[0].style.width = this.w +'px';
3199
3221
  this.c[0].style.display = 'block';
@@ -3309,7 +3331,7 @@ class Circular extends Proto {
3309
3331
 
3310
3332
  let off = this.offset;
3311
3333
  off.x = (this.w*0.5) - ( e.clientX - this.zone.x );
3312
- off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.top );
3334
+ off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
3313
3335
 
3314
3336
  this.r = off.angle() - this.pi90;
3315
3337
  this.r = (((this.r%this.twoPi)+this.twoPi)%this.twoPi);
@@ -3414,6 +3436,8 @@ class Color extends Proto {
3414
3436
  this.cw = this.sb > 256 ? 256 : this.sb;
3415
3437
  if(o.cw != undefined ) this.cw = o.cw;
3416
3438
 
3439
+
3440
+
3417
3441
  // color up or down
3418
3442
  this.side = o.side || 'down';
3419
3443
  this.up = this.side === 'down' ? 0 : 1;
@@ -3424,15 +3448,19 @@ class Color extends Proto {
3424
3448
  this.decal = new V2();
3425
3449
  this.pp = new V2();
3426
3450
 
3427
- this.c[2] = this.dom( 'div', this.css.txt + 'height:'+(this.h-4)+'px;' + 'border-radius:'+this.radius+'px; line-height:'+(this.h-8)+'px;' );
3428
- this.s[2] = this.c[2].style;
3451
+ let cc = this.colors;
3452
+
3453
+ // this.c[2] = this.dom( 'div', this.css.txt + this.css.middle + 'top:1px; height:'+(this.h-2)+'px;' + 'border-radius:'+this.radius+'px; text-shadow:none; border:'+cc.borderSize+'px solid '+cc.border+';' )
3429
3454
 
3430
- this.s[2].textShadow = 'none';
3455
+ this.c[2] = this.dom( 'div', `${this.css.txt} ${this.css.middle} top:1px; height:${this.h-2}px; border-radius:${this.radius}px; text-shadow:none; border:${cc.borderSize}px solid ${cc.border};` );
3456
+ //this.s[2] = this.c[2].style;
3431
3457
 
3432
- if( this.up ){
3458
+ //this.s[2].textShadow = 'none'
3459
+
3460
+ /*if( this.up ){
3433
3461
  this.s[2].top = 'auto';
3434
3462
  this.s[2].bottom = '2px';
3435
- }
3463
+ }*/
3436
3464
 
3437
3465
  //this.c[0].style.textAlign = 'center';
3438
3466
  this.c[0].style.display = 'block';
@@ -3460,10 +3488,10 @@ class Color extends Proto {
3460
3488
  this.hue = 0;
3461
3489
  this.d = 256;
3462
3490
 
3463
- this.setColor( this.value );
3464
-
3465
3491
  this.init();
3466
3492
 
3493
+ this.setColor( this.value );
3494
+
3467
3495
  if( o.open !== undefined ) this.open();
3468
3496
 
3469
3497
  }
@@ -3471,20 +3499,17 @@ class Color extends Proto {
3471
3499
  testZone ( mx, my ) {
3472
3500
 
3473
3501
  let l = this.local;
3474
- if( l.x === -1 && l.y === -1 ) return '';
3475
-
3476
-
3502
+ if( l.x === -1 && l.y === -1 ) return ''
3477
3503
 
3478
3504
  if( this.up && this.isOpen ){
3479
3505
 
3480
- if( l.y > this.wfixe ) return 'title';
3481
- else return 'color';
3506
+ if( l.y > this.wfixe ) return 'title'
3507
+ else return 'color'
3482
3508
 
3483
3509
  } else {
3484
3510
 
3485
- if( l.y < this.baseH+2 ) return 'title';
3486
- else if( this.isOpen ) return 'color';
3487
-
3511
+ if( l.y < this.baseH+2 ) return 'title'
3512
+ else if( this.isOpen ) return 'color'
3488
3513
 
3489
3514
  }
3490
3515
 
@@ -3535,7 +3560,7 @@ class Color extends Proto {
3535
3560
 
3536
3561
  off = this.offset;
3537
3562
  off.x = e.clientX - ( this.zone.x + this.decal.x + this.mid );
3538
- off.y = e.clientY - ( this.zone.y + this.decal.y + this.mid );
3563
+ off.y = e.clientY - ( this.zone.y + this.decal.y + this.mid ) - this.ytop;
3539
3564
  d = off.length() * this.ratio;
3540
3565
  rr = off.angle();
3541
3566
  if(rr < 0) rr += 2 * T.PI;
@@ -3665,7 +3690,6 @@ class Color extends Proto {
3665
3690
 
3666
3691
  this.setSvg( this.c[3], 'fill', cc, 2, 0 );
3667
3692
 
3668
-
3669
3693
  this.s[2].background = this.bcolor;
3670
3694
  if(!this.notext) this.c[2].textContent = Tools.htmlToHex( this.bcolor );
3671
3695
 
@@ -3773,6 +3797,12 @@ class Color extends Proto {
3773
3797
  s[2].width = this.sb + 'px';
3774
3798
  s[2].left = this.sa + 'px';
3775
3799
 
3800
+ //console.log(this.sb)
3801
+
3802
+ this.cw = this.sb > 256 ? 256 : this.sb;
3803
+
3804
+
3805
+
3776
3806
  this.rSizeColor( this.cw );
3777
3807
 
3778
3808
  this.decal.x = Math.floor((this.w - this.wfixe) * 0.5);
@@ -3782,10 +3812,15 @@ class Color extends Proto {
3782
3812
 
3783
3813
  rSizeColor ( w ) {
3784
3814
 
3815
+
3785
3816
  if( w === this.wfixe ) return;
3786
3817
 
3818
+
3819
+
3787
3820
  this.wfixe = w;
3788
3821
 
3822
+
3823
+
3789
3824
  let s = this.s;
3790
3825
 
3791
3826
  //this.decal.x = Math.floor((this.w - this.wfixe) * 0.5);
@@ -4374,7 +4409,7 @@ class Graph extends Proto {
4374
4409
  nup = this.mode( this.isDown ? 2 : 1, name );
4375
4410
  //this.cursor( this.current !== -1 ? 'move' : 'pointer' );
4376
4411
  if(this.isDown){
4377
- this.v[name] = this.clamp( 1 - (( e.clientY - this.zone.y - this.top - 10 ) / this.gh) , 0, 1 );
4412
+ this.v[name] = this.clamp( 1 - (( e.clientY - this.zone.y - this.ytop - 10 ) / this.gh) , 0, 1 );
4378
4413
  this.update( true );
4379
4414
  }
4380
4415
 
@@ -4407,16 +4442,16 @@ class Graph extends Proto {
4407
4442
  wm = w + this.iw*0.5;
4408
4443
  wn = w + this.iw;
4409
4444
 
4410
- if(i===0) p+='M '+w+' '+ h + ' T ' + wm +' '+ h;
4445
+ if( i === 0 ) p+='M '+w+' '+ h + ' T ' + wm +' '+ h;
4411
4446
  else p += ' C ' + ow +' '+ oh + ',' + w +' '+ h + ',' + wm +' '+ h;
4412
- if(i === this.lng-1) p+=' T ' + wn +' '+ h;
4447
+ if( i === this.lng-1 ) p+=' T ' + wn +' '+ h;
4413
4448
 
4414
4449
  ow = wn;
4415
4450
  oh = h;
4416
4451
 
4417
4452
  }
4418
4453
 
4419
- return p;
4454
+ return p
4420
4455
 
4421
4456
  }
4422
4457
 
@@ -4430,7 +4465,6 @@ class Graph extends Proto {
4430
4465
 
4431
4466
  let gw = this.w - 28;
4432
4467
  let iw = ((gw-(4*(this.lng-1)))/this.lng);
4433
-
4434
4468
  let t = [];
4435
4469
 
4436
4470
  s[2].width = gw + 'px';
@@ -4479,6 +4513,10 @@ class Group extends Proto {
4479
4513
  this.c[2] = this.dom( 'div', this.css.basic + flexible + 'width:100%; left:0; height:auto; overflow:hidden; top:'+(this.h)+'px');
4480
4514
  this.c[3] = this.dom( 'path', this.css.basic + 'position:absolute; width:6px; height:6px; left:0; top:'+fltop+'px;', { d:this.svgs.g1, fill:cc.text, stroke:'none'});
4481
4515
 
4516
+ let bh = this.mtop === 0 ? this.margin : this.mtop;
4517
+
4518
+ this.c[4] = this.dom( 'div', this.css.basic + 'width:100%; left:0; height:'+(bh+1)+'px; top:'+((this.h-1))+'px; background:none;');
4519
+
4482
4520
  this.s;
4483
4521
  this.c[1].name = 'group';
4484
4522
 
@@ -4529,11 +4567,13 @@ class Group extends Proto {
4529
4567
 
4530
4568
  let name = '';
4531
4569
 
4532
- if( l.y < this.baseH ) name = 'title';
4570
+ if( l.y < this.baseH + this.margin ) name = 'title';
4533
4571
  else {
4534
4572
  if( this.isOpen ) name = 'content';
4535
4573
  }
4536
4574
 
4575
+ //console.log(name)
4576
+
4537
4577
  return name;
4538
4578
 
4539
4579
  }
@@ -4577,16 +4617,23 @@ class Group extends Proto {
4577
4617
  switch( name ){
4578
4618
 
4579
4619
  case 'content':
4580
- this.cursor();
4620
+
4621
+ //this.cursor()
4622
+
4623
+ //if( this.marginDiv ) e.clientY -= this.margin * 0.5
4581
4624
 
4582
4625
  if( Roots.isMobile && type === 'mousedown' ) this.getNext( e, change );
4583
4626
 
4584
- if( this.proto ) protoChange = this.proto.handleEvent( e );
4627
+ if( this.proto ){
4628
+ //e.clientY -= this.margin
4629
+ protoChange = this.proto.handleEvent( e );
4630
+ }
4585
4631
 
4586
4632
  if( !Roots.lock ) this.getNext( e, change );
4587
4633
 
4588
4634
  break;
4589
4635
  case 'title':
4636
+ //this.cursor( this.isOpen ? 'n-resize':'s-resize' );
4590
4637
  this.cursor('pointer');
4591
4638
  if( type === 'mousedown' ){
4592
4639
  if( this.isOpen ) this.close();
@@ -4644,6 +4691,9 @@ class Group extends Proto {
4644
4691
  }
4645
4692
 
4646
4693
  let u = this.ADD.apply( this, a );
4694
+ //u.margin += this.margin
4695
+
4696
+ //console.log( u.margin )
4647
4697
 
4648
4698
  this.uis.push( u );
4649
4699
 
@@ -4703,9 +4753,9 @@ class Group extends Proto {
4703
4753
  let id = this.uis.indexOf( n );
4704
4754
 
4705
4755
  if ( id !== -1 ) {
4706
- this.calc( - ( this.uis[ id ].h + 1 ) );
4756
+ this.calc( - ( this.uis[ id ].h + this.margin ) );
4707
4757
  this.c[2].removeChild( this.uis[ id ].c[0] );
4708
- this.uis.splice( id, 1 );
4758
+ this.uis.splice( id, 1 );
4709
4759
 
4710
4760
  if( this.uis.length === 0 ){
4711
4761
  this.isEmpty = true;
@@ -4724,18 +4774,22 @@ class Group extends Proto {
4724
4774
  this.setSvg( this.c[3], 'd', this.svgs.g2 );
4725
4775
  this.rSizeContent();
4726
4776
 
4727
- this.h - this.baseH;
4777
+ //let t = this.h - this.baseH
4728
4778
 
4729
4779
  const s = this.s;
4730
4780
  const cc = this.colors;
4731
4781
 
4732
- s[2].top = (this.h-1) + 'px';
4782
+ //s[2].top = (this.h-1) + 'px'
4783
+ s[2].top = (this.h+this.mtop) + 'px';
4784
+ s[4].background = cc.groups;//'#0f0'
4733
4785
 
4734
4786
  if(this.radius){
4735
4787
 
4736
4788
  s[1].borderRadius = '0px';
4737
4789
  s[2].borderRadius = '0px';
4738
4790
 
4791
+
4792
+
4739
4793
  s[1].borderTopLeftRadius = this.radius+'px';
4740
4794
  s[1].borderTopRightRadius = this.radius+'px';
4741
4795
  s[2].borderBottomLeftRadius = this.radius+'px';
@@ -4744,6 +4798,9 @@ class Group extends Proto {
4744
4798
 
4745
4799
  if( cc.gborder !== 'none' ){
4746
4800
 
4801
+ s[4].borderLeft = cc.borderSize+'px solid '+ cc.gborder;
4802
+ s[4].borderRight = cc.borderSize+'px solid '+ cc.gborder;
4803
+
4747
4804
  s[2].border = cc.borderSize+'px solid '+ cc.gborder;
4748
4805
  s[2].borderTop = 'none';
4749
4806
  s[1].borderBottom = cc.borderSize+'px solid rgba(0,0,0,0)';
@@ -4758,7 +4815,7 @@ class Group extends Proto {
4758
4815
 
4759
4816
  super.close();
4760
4817
 
4761
- this.h - this.baseH;
4818
+ //let t = this.h - this.baseH
4762
4819
 
4763
4820
  this.setSvg( this.c[3], 'd', this.svgs.g1 );
4764
4821
 
@@ -4769,10 +4826,13 @@ class Group extends Proto {
4769
4826
 
4770
4827
  s[0].height = this.h + 'px';
4771
4828
  //s[1].height = (this.h-2) + 'px'
4772
- s[2].top = this.h + 'px';
4829
+ //s[2].top = this.h + 'px'
4830
+ s[2].top = (this.h+this.mtop) + 'px';
4831
+ s[4].background = 'none';
4773
4832
 
4774
4833
  if( cc.gborder !== 'none' ){
4775
4834
 
4835
+ s[4].border = 'none';
4776
4836
  s[2].border = 'none';
4777
4837
  s[1].border = cc.borderSize+'px solid '+ cc.gborder;
4778
4838
  }
@@ -4786,7 +4846,8 @@ class Group extends Proto {
4786
4846
  calcUis () {
4787
4847
 
4788
4848
  if( !this.isOpen ) this.h = this.baseH;
4789
- else this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH ) + this.baseH;
4849
+ //else this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH ) + this.baseH;
4850
+ else this.h = Roots.calcUis( this.uis, this.zone, this.zone.y + this.baseH + this.margin ) + this.baseH;
4790
4851
 
4791
4852
  this.s[0].height = this.h + 'px';
4792
4853
 
@@ -4827,7 +4888,6 @@ class Group extends Proto {
4827
4888
  this.w = this.w - this.decal;
4828
4889
 
4829
4890
  s[3].left = ( this.sa + this.sb - 6 ) + 'px';
4830
- //s[1].width = this.isbgGroup ? (this.w-5) + 'px' : this.w + 'px'
4831
4891
 
4832
4892
  s[1].width = this.w + 'px';
4833
4893
  s[2].width = this.w + 'px';
@@ -4838,6 +4898,23 @@ class Group extends Proto {
4838
4898
 
4839
4899
  }
4840
4900
 
4901
+ //
4902
+
4903
+ uiout() {
4904
+
4905
+ if( this.lock ) return;
4906
+ if(this.s) this.s[0].background = this.colors.background;
4907
+
4908
+ }
4909
+
4910
+ uiover() {
4911
+
4912
+ if( this.lock ) return;
4913
+ //if( this.isOpen ) return;
4914
+ if(this.s) this.s[0].background = this.colors.backgroundOver;
4915
+
4916
+ }
4917
+
4841
4918
  }
4842
4919
 
4843
4920
  class Joystick extends Proto {
@@ -4870,7 +4947,6 @@ class Joystick extends Proto {
4870
4947
  this.distance = (this.diam*0.5)*0.25;
4871
4948
 
4872
4949
  this.h = o.h || this.w + 10;
4873
- this.top = 0;
4874
4950
 
4875
4951
  this.c[0].style.width = this.w +'px';
4876
4952
 
@@ -4984,7 +5060,7 @@ class Joystick extends Proto {
4984
5060
  //this.tmp.y = this.radius - ( e.clientY - this.zone.y - this.top );
4985
5061
 
4986
5062
  this.tmp.x = (this.w*0.5) - ( e.clientX - this.zone.x );
4987
- this.tmp.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.top );
5063
+ this.tmp.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
4988
5064
 
4989
5065
  let distance = this.tmp.length();
4990
5066
 
@@ -5102,7 +5178,6 @@ class Knob extends Proto {
5102
5178
  this.offset = new V2();
5103
5179
 
5104
5180
  this.h = o.h || this.w + 10;
5105
- this.top = 0;
5106
5181
 
5107
5182
  this.c[0].style.width = this.w +'px';
5108
5183
  this.c[0].style.display = 'block';
@@ -5221,7 +5296,7 @@ class Knob extends Proto {
5221
5296
  //off.y = this.radius - ( e.clientY - this.zone.y - this.top );
5222
5297
 
5223
5298
  off.x = (this.w*0.5) - ( e.clientX - this.zone.x );
5224
- off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.top );
5299
+ off.y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
5225
5300
 
5226
5301
  this.r = - Math.atan2( off.x, off.y );
5227
5302
 
@@ -5484,6 +5559,8 @@ class List extends Proto {
5484
5559
  this.init();
5485
5560
  if( this.isOpenOnStart ) this.open( true );
5486
5561
 
5562
+ this.baseH += this.mtop;
5563
+
5487
5564
  }
5488
5565
 
5489
5566
  // image list
@@ -5709,6 +5786,7 @@ class List extends Proto {
5709
5786
  this.modeScroll(1);
5710
5787
  if( this.isDown ){
5711
5788
  this.modeScroll(2);
5789
+ //this.update( ( e.clientY - top ) - ( this.sh*0.5 ) );
5712
5790
  let top = this.zone.y+this.baseH-2;
5713
5791
  this.update( ( e.clientY - top ) - ( this.sh*0.5 ) );
5714
5792
  }
@@ -6130,7 +6208,6 @@ class Numeric extends Proto {
6130
6208
  this.allway = o.allway || false;
6131
6209
 
6132
6210
  this.isDown = false;
6133
-
6134
6211
  this.value = [0];
6135
6212
  this.multy = 1;
6136
6213
  this.invmulty = 1;
@@ -6147,10 +6224,10 @@ class Numeric extends Proto {
6147
6224
  this.isDrag = o.drag || false;
6148
6225
 
6149
6226
  if( o.value !== undefined ){
6150
- if(!isNaN(o.value)){
6227
+ if( !isNaN(o.value) ){
6151
6228
  this.value = [o.value];
6152
6229
  } else if( o.value instanceof Array ){
6153
- this.value = o.value;
6230
+ this.value = o.value;
6154
6231
  this.isSingle = false;
6155
6232
  } else if( o.value instanceof Object ){
6156
6233
  this.value = [];
@@ -6158,16 +6235,14 @@ class Numeric extends Proto {
6158
6235
  if( o.value.y !== undefined ) this.value[1] = o.value.y;
6159
6236
  if( o.value.z !== undefined ) this.value[2] = o.value.z;
6160
6237
  if( o.value.w !== undefined ) this.value[3] = o.value.w;
6161
- this.isVector = true;
6162
6238
  this.isSingle = false;
6239
+ this.isVector = true;
6163
6240
  }
6164
6241
  }
6165
6242
 
6166
6243
  this.lng = this.value.length;
6167
6244
  this.tmp = [];
6168
6245
 
6169
-
6170
-
6171
6246
  this.current = -1;
6172
6247
  this.prev = { x:0, y:0, d:0, v:0 };
6173
6248
 
@@ -6181,24 +6256,23 @@ class Numeric extends Proto {
6181
6256
  let i = this.lng;
6182
6257
  while(i--){
6183
6258
 
6184
- if(this.isAngle) this.value[i] = (this.value[i] * 180 / Math.PI).toFixed( this.precision );
6185
- this.c[3+i] = this.dom( 'div', this.css.txtselect + ' height:'+(this.h-4)+'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border+'; border-radius:'+this.radius+'px;');
6259
+ if( this.isAngle ) this.value[i] = (this.value[i] * 180 / Math.PI).toFixed( this.precision );
6260
+ this.c[3+i] = this.dom( 'div', this.css.txtselect + 'top:1px; height:'+(this.h-2)+'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border+'; border-radius:'+this.radius+'px;');
6186
6261
  if(o.center) this.c[2+i].style.textAlign = 'center';
6187
6262
  this.c[3+i].textContent = this.value[i];
6188
6263
  this.c[3+i].style.color = this.colors.text;
6189
6264
  this.c[3+i].isNum = true;
6190
-
6191
6265
  this.cMode[i] = 0;
6192
6266
 
6193
6267
  }
6194
6268
 
6195
6269
  // selection
6196
6270
  this.selectId = 3 + this.lng;
6197
- this.c[this.selectId] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:4px; height:' + (this.h-8) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;');
6271
+ this.c[this.selectId] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:2px; height:' + (this.h-4) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;');
6198
6272
 
6199
6273
  // cursor
6200
6274
  this.cursorId = 4 + this.lng;
6201
- this.c[ this.cursorId ] = this.dom( 'div', this.css.basic + 'top:4px; height:' + (this.h-8) + 'px; width:0px; background:'+cc.text+';' );
6275
+ this.c[ this.cursorId ] = this.dom( 'div', this.css.basic + 'top:2px; height:' + (this.h-4) + 'px; width:0px; background:'+cc.text+';' );
6202
6276
 
6203
6277
  this.init();
6204
6278
  }
@@ -6206,42 +6280,19 @@ class Numeric extends Proto {
6206
6280
  testZone ( e ) {
6207
6281
 
6208
6282
  let l = this.local;
6209
- if( l.x === -1 && l.y === -1 ) return '';
6283
+ if( l.x === -1 && l.y === -1 ) return ''
6210
6284
 
6211
6285
  let i = this.lng;
6212
6286
  let t = this.tmp;
6213
-
6214
6287
 
6215
6288
  while( i-- ){
6216
- if( l.x>t[i][0] && l.x<t[i][2] ) return i;
6289
+ if( l.x>t[i][0] && l.x<t[i][2] ) return i
6217
6290
  }
6218
6291
 
6219
- return '';
6292
+ return ''
6220
6293
 
6221
6294
  }
6222
6295
 
6223
- /* mode: function ( n, name ) {
6224
-
6225
- if( n === this.cMode[name] ) return false;
6226
-
6227
- //let m;
6228
-
6229
- /*switch(n){
6230
-
6231
- case 0: m = this.colors.border; break;
6232
- case 1: m = this.colors.borderOver; break;
6233
- case 2: m = this.colors.borderSelect; break;
6234
-
6235
- }*/
6236
-
6237
- /* this.reset();
6238
- //this.c[name+2].style.borderColor = m;
6239
- this.cMode[name] = n;
6240
-
6241
- return true;
6242
-
6243
- },*/
6244
-
6245
6296
  // ----------------------
6246
6297
  // EVENTS
6247
6298
  // ----------------------
@@ -6254,25 +6305,13 @@ class Numeric extends Proto {
6254
6305
  this.isDown = true;
6255
6306
  if( name !== '' ){
6256
6307
  this.current = name;
6257
- this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
6308
+ this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
6258
6309
  this.setInput( this.c[ 3 + this.current ] );
6259
6310
  }
6260
- return this.mousemove( e );
6311
+ return this.mousemove( e )
6261
6312
  }
6262
6313
 
6263
- return false;
6264
- /*
6265
-
6266
- if( name === '' ) return false;
6267
-
6268
-
6269
- this.current = name;
6270
- this.isDown = true;
6271
-
6272
- this.prev = { x:e.clientX, y:e.clientY, d:0, v: this.isSingle ? parseFloat(this.value) : parseFloat( this.value[ this.current ] ) };
6273
-
6274
-
6275
- return this.mode( 2, name );*/
6314
+ return false
6276
6315
 
6277
6316
  }
6278
6317
 
@@ -6281,35 +6320,12 @@ class Numeric extends Proto {
6281
6320
  if( this.isDown ){
6282
6321
 
6283
6322
  this.isDown = false;
6284
- //this.current = -1;
6285
6323
  this.prev = { x:0, y:0, d:0, v:0 };
6286
6324
 
6287
- return this.mousemove( e );
6325
+ return this.mousemove( e )
6288
6326
  }
6289
6327
 
6290
- return false;
6291
-
6292
- /*let name = this.testZone( e );
6293
- this.isDown = false;
6294
-
6295
- if( this.current !== -1 ){
6296
-
6297
- //let tm = this.current;
6298
- let td = this.prev.d;
6299
-
6300
- this.current = -1;
6301
- this.prev = { x:0, y:0, d:0, v:0 };
6302
-
6303
- if( !td ){
6304
-
6305
- this.setInput( this.c[ 3 + name ] );
6306
- return true;//this.mode( 2, name );
6307
-
6308
- } else {
6309
- return this.reset();//this.mode( 0, tm );
6310
- }
6311
-
6312
- }*/
6328
+ return false
6313
6329
 
6314
6330
  }
6315
6331
 
@@ -6351,38 +6367,20 @@ class Numeric extends Proto {
6351
6367
 
6352
6368
  if( this.isDown ) x = e.clientX - this.zone.x -3;
6353
6369
  if( this.current !== -1 ) x -= this.tmp[this.current][0];
6354
- return this.upInput( x, this.isDown );
6370
+ return this.upInput( x, this.isDown )
6355
6371
 
6356
6372
  }
6357
6373
 
6358
-
6359
-
6360
-
6361
- return nup;
6374
+ return nup
6362
6375
 
6363
6376
  }
6364
6377
 
6365
- //keydown: function ( e ) { return true; },
6366
-
6367
6378
  // ----------------------
6368
6379
 
6369
6380
  reset () {
6370
6381
 
6371
6382
  let nup = false;
6372
- //this.isDown = false;
6373
-
6374
- //this.current = 0;
6375
-
6376
- /* let i = this.lng;
6377
- while(i--){
6378
- if(this.cMode[i]!==0){
6379
- this.cMode[i] = 0;
6380
- //this.c[2+i].style.borderColor = this.colors.border;
6381
- nup = true;
6382
- }
6383
- }*/
6384
-
6385
- return nup;
6383
+ return nup
6386
6384
 
6387
6385
  }
6388
6386
 
@@ -6390,17 +6388,12 @@ class Numeric extends Proto {
6390
6388
  setValue ( v ) {
6391
6389
 
6392
6390
  if( this.isVector ){
6393
-
6394
6391
  if( v.x !== undefined ) this.value[0] = v.x;
6395
6392
  if( v.y !== undefined ) this.value[1] = v.y;
6396
6393
  if( v.z !== undefined ) this.value[2] = v.z;
6397
6394
  if( v.w !== undefined ) this.value[3] = v.w;
6398
-
6399
6395
  } else {
6400
-
6401
- if( this.isSingle ) this.value = [v];
6402
- else this.value = v;
6403
-
6396
+ this.value = this.isSingle ? [v] : v;
6404
6397
  }
6405
6398
 
6406
6399
  this.update();
@@ -6436,9 +6429,7 @@ class Numeric extends Proto {
6436
6429
  if( this.objectLink !== null ){
6437
6430
 
6438
6431
  if( this.isVector ){
6439
-
6440
6432
  this.objectLink[ this.objectKey ].fromArray( v );
6441
-
6442
6433
  } else {
6443
6434
  this.objectLink[ this.objectKey ] = v;
6444
6435
  }
@@ -6446,7 +6437,6 @@ class Numeric extends Proto {
6446
6437
  }
6447
6438
 
6448
6439
  if( this.callback ) this.callback( v, this.objectKey );
6449
-
6450
6440
  this.isSend = false;
6451
6441
 
6452
6442
  }
@@ -6462,9 +6452,6 @@ class Numeric extends Proto {
6462
6452
  let d = this.current !== -1 ? this.tmp[this.current][0] + 5 : 0;
6463
6453
  s[this.cursorId].width = '1px';
6464
6454
  s[this.cursorId].left = ( d + c ) + 'px';
6465
- //s[2].left = ( d + e ) + 'px';
6466
- //s[2].width = w + 'px';
6467
-
6468
6455
  s[this.selectId].left = ( d + e ) + 'px';
6469
6456
  s[this.selectId].width = w + 'px';
6470
6457
  this.c[this.selectId].innerHTML = t;
@@ -6474,7 +6461,7 @@ class Numeric extends Proto {
6474
6461
  unselect () {
6475
6462
 
6476
6463
  let s = this.s;
6477
- if(!s) return;
6464
+ if(!s) return
6478
6465
  this.c[this.selectId].innerHTML = '';
6479
6466
  s[this.selectId].width = 0 + 'px';
6480
6467
  s[this.cursorId].width = 0 + 'px';
@@ -6500,10 +6487,8 @@ class Numeric extends Proto {
6500
6487
  ar[i] = this.value[i] * this.multy;
6501
6488
  }
6502
6489
 
6503
- if( !force ) return;
6504
-
6505
- if( this.isSingle ) this.send( ar[0] );
6506
- else this.send( ar );
6490
+ if( !force ) return
6491
+ this.send( this.isSingle ? ar[0] : ar );
6507
6492
 
6508
6493
  }
6509
6494
 
@@ -6810,17 +6795,17 @@ class TextInput extends Proto {
6810
6795
  let cc = this.colors;
6811
6796
 
6812
6797
  // text
6813
- this.c[2] = this.dom( 'div', this.css.txtselect + 'height:' + (this.h-4) + 'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border+'; border-radius:'+this.radius+'px;' );
6798
+ this.c[2] = this.dom( 'div', this.css.txtselect + 'top:1px; height:' + (this.h-2) + 'px; color:' + cc.text + '; background:' + cc.back + '; borderColor:' + cc.border+'; border-radius:'+this.radius+'px;' );
6814
6799
  this.c[2].textContent = this.value;
6815
6800
 
6816
6801
  // selection
6817
- this.c[3] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:4px; height:' + (this.h-8) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;');
6802
+ this.c[3] = this.dom( 'div', this.css.txtselect + 'position:absolute; top:2px; height:' + (this.h-4) + 'px; padding:0px 0px; width:0px; color:' + cc.textSelect + '; background:' + cc.select + '; border:none; border-radius:0px;');
6818
6803
 
6819
6804
  // cursor
6820
- this.c[4] = this.dom( 'div', this.css.basic + 'top:4px; height:' + (this.h-8) + 'px; width:0px; background:'+cc.text+';' );
6805
+ this.c[4] = this.dom( 'div', this.css.basic + 'top:2px; height:' + (this.h-4) + 'px; width:0px; background:'+cc.text+';' );
6821
6806
 
6822
6807
  // fake
6823
- this.c[5] = this.dom( 'div', this.css.txtselect + 'height:' + (this.h-4) + 'px; justify-content: center; font-style: italic; color:'+cc.border+';' );
6808
+ this.c[5] = this.dom( 'div', this.css.txtselect + 'top:1px; height:' + (this.h-2) + 'px; border:none; justify-content: center; font-style: italic; color:'+cc.border+';' );
6824
6809
  if( this.value === '' ) this.c[5].textContent = this.placeHolder;
6825
6810
 
6826
6811
 
@@ -7037,9 +7022,7 @@ class Select extends Proto {
7037
7022
  super( o );
7038
7023
 
7039
7024
  this.value = o.value || '';
7040
-
7041
7025
  this.isDown = false;
7042
-
7043
7026
  this.onActif = o.onActif || function(){};
7044
7027
 
7045
7028
  //let prefix = o.prefix || '';
@@ -7064,8 +7047,8 @@ class Select extends Proto {
7064
7047
  testZone ( e ) {
7065
7048
 
7066
7049
  let l = this.local;
7067
- if( l.x === -1 && l.y === -1 ) return '';
7068
- if( l.x > this.sa && l.x < this.sa+30 ) return 'over';
7050
+ if( l.x === -1 && l.y === -1 ) return ''
7051
+ if( l.x > this.sa && l.x < this.sa+30 ) return 'over'
7069
7052
  return '0'
7070
7053
 
7071
7054
  }
@@ -7080,10 +7063,10 @@ class Select extends Proto {
7080
7063
  //this.value = false;
7081
7064
  this.isDown = false;
7082
7065
  //this.send();
7083
- return this.mousemove( e );
7066
+ return this.mousemove( e )
7084
7067
  }
7085
7068
 
7086
- return false;
7069
+ return false
7087
7070
 
7088
7071
  }
7089
7072
 
@@ -7091,25 +7074,19 @@ class Select extends Proto {
7091
7074
 
7092
7075
  let name = this.testZone( e );
7093
7076
 
7094
- if( !name ) return false;
7077
+ if( !name ) return false
7095
7078
 
7096
7079
  this.isDown = true;
7097
7080
  //this.value = this.values[ name-2 ];
7098
7081
  //this.send();
7099
- return this.mousemove( e );
7082
+ return this.mousemove( e )
7100
7083
 
7101
7084
  }
7102
7085
 
7103
7086
  mousemove ( e ) {
7104
7087
 
7105
7088
  let up = false;
7106
-
7107
7089
  let name = this.testZone( e );
7108
- //let sel = false;
7109
-
7110
-
7111
-
7112
- //console.log(name)
7113
7090
 
7114
7091
  if( name === 'over' ){
7115
7092
  this.cursor('pointer');
@@ -7118,7 +7095,7 @@ class Select extends Proto {
7118
7095
  up = this.reset();
7119
7096
  }
7120
7097
 
7121
- return up;
7098
+ return up
7122
7099
 
7123
7100
  }
7124
7101
 
@@ -7174,7 +7151,7 @@ class Select extends Proto {
7174
7151
 
7175
7152
  }
7176
7153
 
7177
- return change;
7154
+ return change
7178
7155
 
7179
7156
 
7180
7157
 
@@ -7183,7 +7160,7 @@ class Select extends Proto {
7183
7160
  reset () {
7184
7161
 
7185
7162
  this.cursor();
7186
- return this.mode( this.isActif ? 4 : 1 );
7163
+ return this.mode( this.isActif ? 4 : 1 )
7187
7164
 
7188
7165
  }
7189
7166
 
@@ -7556,21 +7533,24 @@ class Grid extends Proto {
7556
7533
  this.value = o.value || null;
7557
7534
 
7558
7535
 
7536
+ let cc = this.colors;
7537
+
7538
+
7559
7539
  this.isSelectable = o.selectable || false;
7560
- this.spaces = o.spaces || [5,3];
7540
+ this.spaces = o.spaces || [cc.sx,cc.sy];
7561
7541
  this.bsize = o.bsize || [90,20];
7562
7542
 
7563
- if(o.h) this.bsize[1] = o.h;
7543
+ if( o.h ) this.bsize[1] = o.h;
7564
7544
  this.bsizeMax = this.bsize[0];
7565
7545
 
7566
-
7567
7546
  this.tmp = [];
7568
7547
  this.stat = [];
7569
7548
  this.grid = [ 2, Math.round( this.lng * 0.5 ) ];
7570
- this.h = this.grid[1] * ( this.bsize[1] + this.spaces[1] ) + this.spaces[1];
7549
+ this.h = ( this.grid[1] * this.bsize[1] ) + ( (this.grid[1]) * this.spaces[1] ) + 4 - (this.mtop*2); //+ (this.spaces[1] - this.mtop);
7571
7550
 
7572
7551
  this.c[1].textContent = '';
7573
- this.c[2] = this.dom( 'table', this.css.basic + 'width:100%; top:'+(this.spaces[1]-2)+'px; height:auto; border-collapse:separate; border:none; border-spacing: '+(this.spaces[0]-2)+'px '+(this.spaces[1]-2)+'px;' );
7552
+ //this.c[2] = this.dom( 'table', this.css.basic + 'width:100%; top:'+(this.spaces[1]-2)+'px; height:auto; border-collapse:separate; border:none; border-spacing: '+(this.spaces[0]-2)+'px '+(this.spaces[1]-2)+'px;' );
7553
+ this.c[2] = this.dom( 'table', this.css.basic + 'width:100%; border-spacing: '+(this.spaces[0]-2)+'px '+(this.spaces[1])+'px; border:none;' );
7574
7554
 
7575
7555
  let n = 0, b, td, tr, sel;
7576
7556
 
@@ -7578,13 +7558,11 @@ class Grid extends Proto {
7578
7558
  this.isDown = false;
7579
7559
  this.neverlock = true;
7580
7560
 
7581
- this.buttons = [];
7561
+ this.buttons = [];
7582
7562
  this.stat = [];
7583
7563
  this.tmpX = [];
7584
7564
  this.tmpY = [];
7585
7565
 
7586
- let cc = this.colors;
7587
-
7588
7566
  for( let i = 0; i < this.grid[1]; i++ ){
7589
7567
 
7590
7568
  tr = this.c[2].insertRow();
@@ -7625,6 +7603,8 @@ class Grid extends Proto {
7625
7603
  }
7626
7604
  }
7627
7605
 
7606
+ //this.s[0].border = 'none'
7607
+
7628
7608
  this.init();
7629
7609
 
7630
7610
  }
@@ -7633,6 +7613,8 @@ class Grid extends Proto {
7633
7613
 
7634
7614
  let l = this.local;
7635
7615
  if( l.x === -1 && l.y === -1 ) return -1;
7616
+
7617
+ l.y += this.mtop;
7636
7618
 
7637
7619
  let tx = this.tmpX;
7638
7620
  let ty = this.tmpY;
@@ -7887,7 +7869,6 @@ class Pad2D extends Proto {
7887
7869
 
7888
7870
 
7889
7871
  this.h = o.h || this.w + 10;
7890
- this.top = 0;
7891
7872
 
7892
7873
  this.c[0].style.width = this.w + 'px';
7893
7874
 
@@ -7901,6 +7882,8 @@ class Pad2D extends Proto {
7901
7882
 
7902
7883
  }
7903
7884
 
7885
+ //this.top -= this.margin
7886
+
7904
7887
  let cc = this.colors;
7905
7888
 
7906
7889
 
@@ -7934,6 +7917,8 @@ class Pad2D extends Proto {
7934
7917
 
7935
7918
  if( l.x === -1 && l.y === -1 ) return '';
7936
7919
 
7920
+
7921
+
7937
7922
  if( l.y <= this.c[ 1 ].offsetHeight ) return 'title';
7938
7923
  else if ( l.y > this.h - this.c[ 2 ].offsetHeight ) return 'text';
7939
7924
  else return 'pad';
@@ -7950,7 +7935,7 @@ class Pad2D extends Proto {
7950
7935
 
7951
7936
  this.isDown = false;
7952
7937
  return this.mode(0);
7953
-
7938
+
7954
7939
  }
7955
7940
 
7956
7941
  mousedown ( e ) {
@@ -7969,7 +7954,9 @@ class Pad2D extends Proto {
7969
7954
  if( !this.isDown ) return;
7970
7955
 
7971
7956
  let x = (this.w*0.5) - ( e.clientX - this.zone.x );
7972
- let y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.top );
7957
+ let y = (this.diam*0.5) - ( e.clientY - this.zone.y - this.ytop );
7958
+
7959
+
7973
7960
  let r = 256 / this.diam;
7974
7961
 
7975
7962
  x = -(x*r);
@@ -8270,6 +8257,9 @@ class Gui {
8270
8257
  //this.prevY = -1;
8271
8258
  this.sw = 0;
8272
8259
 
8260
+ this.margin = this.colors.sy;
8261
+ this.marginDiv = Tools.isDivid( this.margin );
8262
+
8273
8263
 
8274
8264
 
8275
8265
  // bottom and close height
@@ -8591,7 +8581,7 @@ class Gui {
8591
8581
 
8592
8582
  case 'content':
8593
8583
 
8594
- e.clientY = this.isScroll ? e.clientY + this.decal : e.clientY;
8584
+ e.clientY = this.isScroll ? e.clientY + this.decal : e.clientY;
8595
8585
 
8596
8586
  if( Roots.isMobile && type === 'mousedown' ) this.getNext( e, change );
8597
8587
 
@@ -8651,7 +8641,6 @@ class Gui {
8651
8641
  if( next !== this.current ){
8652
8642
  this.clearTarget();
8653
8643
  this.current = next;
8654
-
8655
8644
  this.isNewTarget = true;
8656
8645
 
8657
8646
  }
@@ -8825,7 +8814,7 @@ class Gui {
8825
8814
  while(i--){
8826
8815
  if( this.uis[i].value === name ){
8827
8816
  this.uis[i].selected( true );
8828
- if( this.isScroll ) this.update( ( i*(this.uis[i].h+1) )*this.ratio );
8817
+ if( this.isScroll ) this.update( ( i*(this.uis[i].h+this.margin) )*this.ratio );
8829
8818
  }
8830
8819
  }
8831
8820
 
@@ -8931,7 +8920,6 @@ class Gui {
8931
8920
 
8932
8921
 
8933
8922
  if( this.forceHeight && this.lockHeight ) this.content.style.height = this.forceHeight + 'px';
8934
-
8935
8923
  if( this.isCanvas ) this.draw( true );
8936
8924
 
8937
8925
  }
@@ -8945,11 +8933,8 @@ class Gui {
8945
8933
  if( w ) this.zone.w = w;
8946
8934
 
8947
8935
  this.zone.w = Math.floor( this.zone.w );
8948
-
8949
8936
  this.content.style.width = this.zone.w + 'px';
8950
-
8951
8937
  if( this.isCenter ) this.content.style.marginLeft = -(Math.floor(this.zone.w*0.5)) + 'px';
8952
-
8953
8938
  this.setItemWidth( this.zone.w - this.sw );
8954
8939
 
8955
8940
  }
@@ -8966,6 +8951,6 @@ class Gui {
8966
8951
 
8967
8952
  }
8968
8953
 
8969
- const REVISION = '4.2.3';
8954
+ const REVISION = '4.2.5';
8970
8955
 
8971
8956
  export { Files, Gui, Proto, REVISION, Tools, add };