@fieldnotes/core 0.50.4 → 0.50.6

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/index.cjs CHANGED
@@ -1954,7 +1954,7 @@ var InputHandler = class {
1954
1954
  if (this.activePointers.has(e.pointerId)) {
1955
1955
  this.activePointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
1956
1956
  }
1957
- if (this.activePointers.size === 2) {
1957
+ if (this.activePointers.size >= 2) {
1958
1958
  this.handlePinchMove();
1959
1959
  return;
1960
1960
  }
@@ -1988,9 +1988,15 @@ var InputHandler = class {
1988
1988
  this.element.releasePointerCapture(e.pointerId);
1989
1989
  } catch {
1990
1990
  }
1991
- this.activePointers.delete(e.pointerId);
1992
- if (this.activePointers.size < 2) {
1991
+ const removedActivePointer = this.activePointers.delete(e.pointerId);
1992
+ if (removedActivePointer && this.activePointers.size >= 2) {
1993
+ this.startPinch();
1994
+ } else if (this.activePointers.size < 2) {
1993
1995
  this.lastPinchDistance = 0;
1996
+ const remainingPointer = this.activePointers.values().next().value;
1997
+ if (remainingPointer && this.isPanning) {
1998
+ this.lastPointer = { ...remainingPointer };
1999
+ }
1994
2000
  }
1995
2001
  if (this.isPanning && this.activePointers.size === 0) {
1996
2002
  this.isPanning = false;
@@ -2032,7 +2038,11 @@ var InputHandler = class {
2032
2038
  if (this.lastPinchDistance > 0) {
2033
2039
  const scale = dist / this.lastPinchDistance;
2034
2040
  const newZoom = this.camera.zoom * scale;
2035
- this.camera.zoomAt(newZoom, center2);
2041
+ const rect = this.element.getBoundingClientRect();
2042
+ this.camera.zoomAt(newZoom, {
2043
+ x: center2.x - rect.left,
2044
+ y: center2.y - rect.top
2045
+ });
2036
2046
  }
2037
2047
  const dx = center2.x - this.lastPointer.x;
2038
2048
  const dy = center2.y - this.lastPointer.y;
@@ -10714,7 +10724,7 @@ var LaserTool = class {
10714
10724
  };
10715
10725
 
10716
10726
  // src/index.ts
10717
- var VERSION = "0.50.4";
10727
+ var VERSION = "0.50.6";
10718
10728
  // Annotate the CommonJS export names for ESM import in node:
10719
10729
  0 && (module.exports = {
10720
10730
  ArrowTool,