perfect-gui 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perfect-gui",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "Nice and simple GUI for JavaScript",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -12,6 +12,7 @@ export default class GUI {
12
12
  }
13
13
 
14
14
  this.propReferences = [];
15
+ this.folders = [];
15
16
 
16
17
  if ( options.isFolder ) {
17
18
  this._folderConstructor(options.folderOptions);
@@ -72,8 +73,6 @@ export default class GUI {
72
73
 
73
74
  this.closed = false;
74
75
  if (options.closed) this.toggleClose();
75
-
76
- this.folders = [];
77
76
  }
78
77
 
79
78
  _styleInstance() {
@@ -512,8 +511,8 @@ export default class GUI {
512
511
  el: 'div',
513
512
  class: 'p-gui__vector2-area',
514
513
  onclick: (evt) => {
515
- objectX[propX] = parseFloat(this._mapLinear(evt.offsetX, 0, area.clientWidth, minX, maxX).toFixed(1));
516
- objectY[propY] = parseFloat(this._mapLinear(evt.offsetY, 0, area.clientHeight, maxY, minY).toFixed(1));
514
+ objectX[propX] = parseFloat(this._mapLinear(evt.offsetX, 0, area.clientWidth, minX, maxX).toFixed(2));
515
+ objectY[propY] = parseFloat(this._mapLinear(evt.offsetY, 0, area.clientHeight, maxY, minY).toFixed(2));
517
516
 
518
517
  if (callback) {
519
518
  callback(objectX[propX], objectX[propY]);
@@ -529,8 +528,8 @@ export default class GUI {
529
528
  });
530
529
  area.addEventListener('pointermove', (evt) => {
531
530
  if (pointer_is_down) {
532
- objectX[propX] = parseFloat(this._mapLinear(evt.offsetX, 0, area.clientWidth, minX, maxX).toFixed(1));
533
- objectY[propY] = parseFloat(this._mapLinear(evt.offsetY, 0, area.clientHeight, maxY, minY).toFixed(1));
531
+ objectX[propX] = parseFloat(this._mapLinear(evt.offsetX, 0, area.clientWidth, minX, maxX).toFixed(2));
532
+ objectY[propY] = parseFloat(this._mapLinear(evt.offsetY, 0, area.clientHeight, maxY, minY).toFixed(2));
534
533
 
535
534
  if (callback) {
536
535
  callback(objectX[propX], objectX[propY]);
@@ -630,7 +629,7 @@ export default class GUI {
630
629
  if (this.folders.length == 0) {
631
630
  className += ' p-gui__folder--first';
632
631
  }
633
-
632
+
634
633
  if (closed) {
635
634
  className += ' p-gui__folder--closed';
636
635
  }
package/src/styles.js CHANGED
@@ -24,6 +24,7 @@ return /* css */`
24
24
  user-select: none;
25
25
  border-bottom-right-radius: 3px;
26
26
  border-bottom-left-radius: 3px;
27
+ cursor: auto;
27
28
  }
28
29
 
29
30
  .p-gui * {