@open-slot-ui/pixi 0.11.1 → 0.12.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/dist/art.js CHANGED
@@ -1,4 +1,4 @@
1
- import { svgSpinSkin } from './chunk-Z7X5JH7H.js';
1
+ import { svgSpinSkin } from './chunk-FN6UJ3WO.js';
2
2
  import { CanvasSource, Texture, Rectangle } from 'pixi.js';
3
3
 
4
4
  async function svgToTexture(svg, resolution = 3) {
@@ -1332,6 +1332,7 @@ var ValueDisplayView = class extends ControlView {
1332
1332
  super.dispose();
1333
1333
  }
1334
1334
  };
1335
+ var TAP_SLOP = 24;
1335
1336
  var GLYPH_SVG = {
1336
1337
  speaker: '<svg viewBox="0 0 22.5 22.5" xmlns="http://www.w3.org/2000/svg"><path d="M13.6745 5.01252C13.9316 4.84399 14.2647 4.8292 14.5397 4.97456C14.8146 5.1199 14.9868 5.40142 14.9872 5.706L15.0007 16.8107C15.0011 17.1153 14.8296 17.3934 14.555 17.5333C14.2804 17.6731 13.9472 17.6517 13.6897 17.4781L10.4454 15.2905L8.61605 15.2722C6.76074 15.2537 5.25495 13.7655 5.25266 11.9484L5.25073 10.3739C5.2486 8.55679 6.75081 7.09863 8.6061 7.11714L10.4355 7.13539L13.6745 5.01252Z" fill="none" stroke="black" stroke-width="1.5" stroke-linejoin="round"/><path d="M16.1933 9.375C16.6252 10.4652 16.6015 11.654 16.1257 12.75" fill="none" stroke="black" stroke-width="3" stroke-linecap="round"/></svg>',
1337
1338
  "speaker-mute": '<svg viewBox="0 0 22.5 22.5" xmlns="http://www.w3.org/2000/svg"><path d="M13.6745 5.01252C13.9316 4.84399 14.2647 4.8292 14.5397 4.97456C14.8146 5.1199 14.9868 5.40142 14.9872 5.706L15.0007 16.8107C15.0011 17.1153 14.8296 17.3934 14.555 17.5333C14.2804 17.6731 13.9472 17.6517 13.6897 17.4781L10.4454 15.2905L8.61605 15.2722C6.76074 15.2537 5.25495 13.7655 5.25266 11.9484L5.25073 10.3739C5.2486 8.55679 6.75081 7.09863 8.6061 7.11714L10.4355 7.13539L13.6745 5.01252Z" fill="none" stroke="black" stroke-width="1.5" stroke-linejoin="round"/><path d="M15.5 8.5L19.5 13.5M19.5 8.5L15.5 13.5" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round"/></svg>',
@@ -1429,17 +1430,26 @@ var ButtonView = class extends ControlView {
1429
1430
  this.sprite.scale.set(1);
1430
1431
  this.sprite.scale.set(this.iconTarget / this.sprite.height);
1431
1432
  }
1432
- onDown = () => {
1433
- if (this.btn.interactable) this.btn.setState("pressed");
1433
+ /** Screen position of the current press, for the tap-slop check on release. */
1434
+ downPt = null;
1435
+ onDown = (e) => {
1436
+ if (!this.btn.interactable) return;
1437
+ this.btn.setState("pressed");
1438
+ this.downPt = { x: e.global.x, y: e.global.y };
1434
1439
  };
1435
1440
  onUp = () => {
1436
1441
  if (this.btn.current === "pressed") {
1437
1442
  this.btn.setState("idle");
1438
1443
  this.btn.activate();
1439
1444
  }
1445
+ this.downPt = null;
1440
1446
  };
1441
- onUpOutside = () => {
1442
- if (this.btn.current === "pressed") this.btn.setState("idle");
1447
+ onUpOutside = (e) => {
1448
+ const p = this.downPt;
1449
+ this.downPt = null;
1450
+ if (this.btn.current !== "pressed") return;
1451
+ this.btn.setState("idle");
1452
+ if (p && Math.hypot(e.global.x - p.x, e.global.y - p.y) <= TAP_SLOP) this.btn.activate();
1443
1453
  };
1444
1454
  updateHit() {
1445
1455
  if (this.sprite) {
@@ -3732,5 +3742,5 @@ function svgSpinSkin(textures) {
3732
3742
  }
3733
3743
 
3734
3744
  export { AutoplayDrawerView, AutoplayView, ButtonView, ControlView, DialogView, MenuView, OpenUIPixi, ReadoutView, SelectView, SliderView, SpinView, StepperView, TextCellRenderer, ToggleView, TurboView, Tweener, ValueDisplayView, buildBlockColumn, defaultSpinSkin, drawSpin, isDesktop, svgSpinSkin };
3735
- //# sourceMappingURL=chunk-Z7X5JH7H.js.map
3736
- //# sourceMappingURL=chunk-Z7X5JH7H.js.map
3745
+ //# sourceMappingURL=chunk-FN6UJ3WO.js.map
3746
+ //# sourceMappingURL=chunk-FN6UJ3WO.js.map