perfect-gui 3.5.10 → 3.5.11

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 CHANGED
@@ -172,6 +172,4 @@ gui.toggleClose();
172
172
 
173
173
 
174
174
  ## To do
175
- - Vector2 drag & drop
176
- - Style list component
177
- - Image button selection outline
175
+ - Style list component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perfect-gui",
3
- "version": "3.5.10",
3
+ "version": "3.5.11",
4
4
  "description": "Nice and simple GUI for JavaScript.",
5
5
  "main": "src/index.js",
6
6
  "directories": {
package/src/index.js CHANGED
@@ -459,6 +459,19 @@ export default class GUI {
459
459
  onclick: (evt) => {
460
460
  objectX[propX] = parseFloat(this._mapLinear(evt.offsetX, 0, area.clientWidth, minX, maxX).toFixed(1));
461
461
  objectY[propY] = parseFloat(this._mapLinear(evt.offsetY, 0, area.clientHeight, maxY, minY).toFixed(1));
462
+ },
463
+ });
464
+ let pointer_is_down = false;
465
+ area.addEventListener('pointerdown', (evt) => {
466
+ pointer_is_down = true;
467
+ });
468
+ area.addEventListener('pointerup', () => {
469
+ pointer_is_down = false;
470
+ });
471
+ area.addEventListener('pointermove', (evt) => {
472
+ if (pointer_is_down) {
473
+ objectX[propX] = parseFloat(this._mapLinear(evt.offsetX, 0, area.clientWidth, minX, maxX).toFixed(1));
474
+ objectY[propY] = parseFloat(this._mapLinear(evt.offsetY, 0, area.clientHeight, maxY, minY).toFixed(1));
462
475
  }
463
476
  });
464
477
 
@@ -24,7 +24,7 @@
24
24
  <link rel="apple-touch-icon" sizes="180x180" href="https://raw.githubusercontent.com/thibka/thibka.github.io/master/perfect-gui/_data/fav/180x180.png">
25
25
  <link rel="icon" type="image/png" sizes="32x32" href="https://raw.githubusercontent.com/thibka/thibka.github.io/master/perfect-gui/_data/fav/32x32.png">
26
26
  <link rel="icon" type="image/png" sizes="16x16" href="https://raw.githubusercontent.com/thibka/thibka.github.io/master/perfect-gui/_data/fav/16x16.png">
27
- <link rel="shortcut icon" href="https://raw.githubusercontent.com/thibka/thibka.github.io/master/perfect-gui/_data/fav/180x180.ico">
27
+ <link rel="shortcut icon" href="https://raw.githubusercontent.com/thibka/thibka.github.io/master/perfect-gui/_data/fav/180x180.png">
28
28
  </head>
29
29
 
30
30
  <body>