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 +1 -3
- package/package.json +1 -1
- package/src/index.js +13 -0
- package/test/src/index.html +1 -1
package/README.md
CHANGED
package/package.json
CHANGED
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
|
|
package/test/src/index.html
CHANGED
|
@@ -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.
|
|
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>
|