microboard-temp 0.13.28 → 0.13.29

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.
@@ -37830,13 +37830,14 @@ class Connector2 extends BaseItem {
37830
37830
  const start = this.startPoint;
37831
37831
  if (start.pointType !== "Fixed" && start.pointType !== "Floating")
37832
37832
  return;
37833
- const startEdge = start.getEdge();
37834
- if (!startEdge)
37835
- return;
37836
37833
  const item = start.item;
37837
37834
  const anchors = item.getSnapAnchorPoints?.();
37838
37835
  if (!anchors || anchors.length === 0)
37839
37836
  return;
37837
+ const EPS = 2;
37838
+ const isOnAnchor = anchors.some((a2) => Math.abs(a2.x - start.x) < EPS && Math.abs(a2.y - start.y) < EPS);
37839
+ if (!isOnAnchor)
37840
+ return;
37840
37841
  const center = item.getMbr().getCenter();
37841
37842
  const dx = this.endPoint.x - center.x;
37842
37843
  const dy = this.endPoint.y - center.y;
@@ -37856,11 +37857,9 @@ class Connector2 extends BaseItem {
37856
37857
  best = anchor;
37857
37858
  }
37858
37859
  }
37859
- const bestRel = toRelativePoint(best, item);
37860
- const cur = start.relativePoint;
37861
- if (Math.abs(bestRel.x - cur.x) < 0.5 && Math.abs(bestRel.y - cur.y) < 0.5)
37860
+ if (Math.abs(best.x - start.x) < EPS && Math.abs(best.y - start.y) < EPS)
37862
37861
  return;
37863
- this.startPoint = new FixedPoint(item, bestRel);
37862
+ this.startPoint = new FixedPoint(item, toRelativePoint(best, item));
37864
37863
  }
37865
37864
  clearObservedItems() {
37866
37865
  const startPoint = this.getStartPoint();
package/dist/cjs/index.js CHANGED
@@ -37830,13 +37830,14 @@ class Connector2 extends BaseItem {
37830
37830
  const start = this.startPoint;
37831
37831
  if (start.pointType !== "Fixed" && start.pointType !== "Floating")
37832
37832
  return;
37833
- const startEdge = start.getEdge();
37834
- if (!startEdge)
37835
- return;
37836
37833
  const item = start.item;
37837
37834
  const anchors = item.getSnapAnchorPoints?.();
37838
37835
  if (!anchors || anchors.length === 0)
37839
37836
  return;
37837
+ const EPS = 2;
37838
+ const isOnAnchor = anchors.some((a2) => Math.abs(a2.x - start.x) < EPS && Math.abs(a2.y - start.y) < EPS);
37839
+ if (!isOnAnchor)
37840
+ return;
37840
37841
  const center = item.getMbr().getCenter();
37841
37842
  const dx = this.endPoint.x - center.x;
37842
37843
  const dy = this.endPoint.y - center.y;
@@ -37856,11 +37857,9 @@ class Connector2 extends BaseItem {
37856
37857
  best = anchor;
37857
37858
  }
37858
37859
  }
37859
- const bestRel = toRelativePoint(best, item);
37860
- const cur = start.relativePoint;
37861
- if (Math.abs(bestRel.x - cur.x) < 0.5 && Math.abs(bestRel.y - cur.y) < 0.5)
37860
+ if (Math.abs(best.x - start.x) < EPS && Math.abs(best.y - start.y) < EPS)
37862
37861
  return;
37863
- this.startPoint = new FixedPoint(item, bestRel);
37862
+ this.startPoint = new FixedPoint(item, toRelativePoint(best, item));
37864
37863
  }
37865
37864
  clearObservedItems() {
37866
37865
  const startPoint = this.getStartPoint();
package/dist/cjs/node.js CHANGED
@@ -40303,13 +40303,14 @@ class Connector2 extends BaseItem {
40303
40303
  const start = this.startPoint;
40304
40304
  if (start.pointType !== "Fixed" && start.pointType !== "Floating")
40305
40305
  return;
40306
- const startEdge = start.getEdge();
40307
- if (!startEdge)
40308
- return;
40309
40306
  const item = start.item;
40310
40307
  const anchors = item.getSnapAnchorPoints?.();
40311
40308
  if (!anchors || anchors.length === 0)
40312
40309
  return;
40310
+ const EPS = 2;
40311
+ const isOnAnchor = anchors.some((a2) => Math.abs(a2.x - start.x) < EPS && Math.abs(a2.y - start.y) < EPS);
40312
+ if (!isOnAnchor)
40313
+ return;
40313
40314
  const center = item.getMbr().getCenter();
40314
40315
  const dx = this.endPoint.x - center.x;
40315
40316
  const dy = this.endPoint.y - center.y;
@@ -40329,11 +40330,9 @@ class Connector2 extends BaseItem {
40329
40330
  best = anchor;
40330
40331
  }
40331
40332
  }
40332
- const bestRel = toRelativePoint(best, item);
40333
- const cur = start.relativePoint;
40334
- if (Math.abs(bestRel.x - cur.x) < 0.5 && Math.abs(bestRel.y - cur.y) < 0.5)
40333
+ if (Math.abs(best.x - start.x) < EPS && Math.abs(best.y - start.y) < EPS)
40335
40334
  return;
40336
- this.startPoint = new FixedPoint(item, bestRel);
40335
+ this.startPoint = new FixedPoint(item, toRelativePoint(best, item));
40337
40336
  }
40338
40337
  clearObservedItems() {
40339
40338
  const startPoint = this.getStartPoint();
@@ -37659,13 +37659,14 @@ class Connector2 extends BaseItem {
37659
37659
  const start = this.startPoint;
37660
37660
  if (start.pointType !== "Fixed" && start.pointType !== "Floating")
37661
37661
  return;
37662
- const startEdge = start.getEdge();
37663
- if (!startEdge)
37664
- return;
37665
37662
  const item = start.item;
37666
37663
  const anchors = item.getSnapAnchorPoints?.();
37667
37664
  if (!anchors || anchors.length === 0)
37668
37665
  return;
37666
+ const EPS = 2;
37667
+ const isOnAnchor = anchors.some((a2) => Math.abs(a2.x - start.x) < EPS && Math.abs(a2.y - start.y) < EPS);
37668
+ if (!isOnAnchor)
37669
+ return;
37669
37670
  const center = item.getMbr().getCenter();
37670
37671
  const dx = this.endPoint.x - center.x;
37671
37672
  const dy = this.endPoint.y - center.y;
@@ -37685,11 +37686,9 @@ class Connector2 extends BaseItem {
37685
37686
  best = anchor;
37686
37687
  }
37687
37688
  }
37688
- const bestRel = toRelativePoint(best, item);
37689
- const cur = start.relativePoint;
37690
- if (Math.abs(bestRel.x - cur.x) < 0.5 && Math.abs(bestRel.y - cur.y) < 0.5)
37689
+ if (Math.abs(best.x - start.x) < EPS && Math.abs(best.y - start.y) < EPS)
37691
37690
  return;
37692
- this.startPoint = new FixedPoint(item, bestRel);
37691
+ this.startPoint = new FixedPoint(item, toRelativePoint(best, item));
37693
37692
  }
37694
37693
  clearObservedItems() {
37695
37694
  const startPoint = this.getStartPoint();
package/dist/esm/index.js CHANGED
@@ -37652,13 +37652,14 @@ class Connector2 extends BaseItem {
37652
37652
  const start = this.startPoint;
37653
37653
  if (start.pointType !== "Fixed" && start.pointType !== "Floating")
37654
37654
  return;
37655
- const startEdge = start.getEdge();
37656
- if (!startEdge)
37657
- return;
37658
37655
  const item = start.item;
37659
37656
  const anchors = item.getSnapAnchorPoints?.();
37660
37657
  if (!anchors || anchors.length === 0)
37661
37658
  return;
37659
+ const EPS = 2;
37660
+ const isOnAnchor = anchors.some((a2) => Math.abs(a2.x - start.x) < EPS && Math.abs(a2.y - start.y) < EPS);
37661
+ if (!isOnAnchor)
37662
+ return;
37662
37663
  const center = item.getMbr().getCenter();
37663
37664
  const dx = this.endPoint.x - center.x;
37664
37665
  const dy = this.endPoint.y - center.y;
@@ -37678,11 +37679,9 @@ class Connector2 extends BaseItem {
37678
37679
  best = anchor;
37679
37680
  }
37680
37681
  }
37681
- const bestRel = toRelativePoint(best, item);
37682
- const cur = start.relativePoint;
37683
- if (Math.abs(bestRel.x - cur.x) < 0.5 && Math.abs(bestRel.y - cur.y) < 0.5)
37682
+ if (Math.abs(best.x - start.x) < EPS && Math.abs(best.y - start.y) < EPS)
37684
37683
  return;
37685
- this.startPoint = new FixedPoint(item, bestRel);
37684
+ this.startPoint = new FixedPoint(item, toRelativePoint(best, item));
37686
37685
  }
37687
37686
  clearObservedItems() {
37688
37687
  const startPoint = this.getStartPoint();
package/dist/esm/node.js CHANGED
@@ -40120,13 +40120,14 @@ class Connector2 extends BaseItem {
40120
40120
  const start = this.startPoint;
40121
40121
  if (start.pointType !== "Fixed" && start.pointType !== "Floating")
40122
40122
  return;
40123
- const startEdge = start.getEdge();
40124
- if (!startEdge)
40125
- return;
40126
40123
  const item = start.item;
40127
40124
  const anchors = item.getSnapAnchorPoints?.();
40128
40125
  if (!anchors || anchors.length === 0)
40129
40126
  return;
40127
+ const EPS = 2;
40128
+ const isOnAnchor = anchors.some((a2) => Math.abs(a2.x - start.x) < EPS && Math.abs(a2.y - start.y) < EPS);
40129
+ if (!isOnAnchor)
40130
+ return;
40130
40131
  const center = item.getMbr().getCenter();
40131
40132
  const dx = this.endPoint.x - center.x;
40132
40133
  const dy = this.endPoint.y - center.y;
@@ -40146,11 +40147,9 @@ class Connector2 extends BaseItem {
40146
40147
  best = anchor;
40147
40148
  }
40148
40149
  }
40149
- const bestRel = toRelativePoint(best, item);
40150
- const cur = start.relativePoint;
40151
- if (Math.abs(bestRel.x - cur.x) < 0.5 && Math.abs(bestRel.y - cur.y) < 0.5)
40150
+ if (Math.abs(best.x - start.x) < EPS && Math.abs(best.y - start.y) < EPS)
40152
40151
  return;
40153
- this.startPoint = new FixedPoint(item, bestRel);
40152
+ this.startPoint = new FixedPoint(item, toRelativePoint(best, item));
40154
40153
  }
40155
40154
  clearObservedItems() {
40156
40155
  const startPoint = this.getStartPoint();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.28",
3
+ "version": "0.13.29",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",