microboard-temp 0.6.4 → 0.6.5
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/cjs/browser.js +13 -14
- package/dist/cjs/index.js +13 -14
- package/dist/cjs/node.js +13 -14
- package/dist/esm/browser.js +13 -14
- package/dist/esm/index.js +13 -14
- package/dist/esm/node.js +13 -14
- package/package.json +1 -1
package/dist/cjs/browser.js
CHANGED
|
@@ -49452,32 +49452,31 @@ class Camera {
|
|
|
49452
49452
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
49453
49453
|
}
|
|
49454
49454
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
49455
|
-
const
|
|
49456
|
-
const
|
|
49457
|
-
const
|
|
49458
|
-
const
|
|
49455
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
49456
|
+
const startScaleX = base3.scaleX;
|
|
49457
|
+
const startScaleY = base3.scaleY;
|
|
49458
|
+
const startTranslateX = base3.translateX;
|
|
49459
|
+
const startTranslateY = base3.translateY;
|
|
49459
49460
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
49460
49461
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
49461
|
-
const
|
|
49462
|
-
const
|
|
49463
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
49464
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
49465
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
49466
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
49462
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
49463
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
49467
49464
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
49468
49465
|
return;
|
|
49469
49466
|
}
|
|
49467
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
49468
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
49470
49469
|
if (duration === 0) {
|
|
49471
|
-
this.matrix.translateX =
|
|
49472
|
-
this.matrix.translateY =
|
|
49470
|
+
this.matrix.translateX = finalTranslateX;
|
|
49471
|
+
this.matrix.translateY = finalTranslateY;
|
|
49473
49472
|
this.matrix.scaleX = finalScaleX;
|
|
49474
49473
|
this.matrix.scaleY = finalScaleY;
|
|
49475
49474
|
this.subject.publish(this);
|
|
49476
49475
|
return;
|
|
49477
49476
|
}
|
|
49478
49477
|
this.animateLocalToTarget({
|
|
49479
|
-
translateX:
|
|
49480
|
-
translateY:
|
|
49478
|
+
translateX: finalTranslateX,
|
|
49479
|
+
translateY: finalTranslateY,
|
|
49481
49480
|
scaleX: finalScaleX,
|
|
49482
49481
|
scaleY: finalScaleY
|
|
49483
49482
|
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -49452,32 +49452,31 @@ class Camera {
|
|
|
49452
49452
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
49453
49453
|
}
|
|
49454
49454
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
49455
|
-
const
|
|
49456
|
-
const
|
|
49457
|
-
const
|
|
49458
|
-
const
|
|
49455
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
49456
|
+
const startScaleX = base3.scaleX;
|
|
49457
|
+
const startScaleY = base3.scaleY;
|
|
49458
|
+
const startTranslateX = base3.translateX;
|
|
49459
|
+
const startTranslateY = base3.translateY;
|
|
49459
49460
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
49460
49461
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
49461
|
-
const
|
|
49462
|
-
const
|
|
49463
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
49464
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
49465
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
49466
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
49462
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
49463
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
49467
49464
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
49468
49465
|
return;
|
|
49469
49466
|
}
|
|
49467
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
49468
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
49470
49469
|
if (duration === 0) {
|
|
49471
|
-
this.matrix.translateX =
|
|
49472
|
-
this.matrix.translateY =
|
|
49470
|
+
this.matrix.translateX = finalTranslateX;
|
|
49471
|
+
this.matrix.translateY = finalTranslateY;
|
|
49473
49472
|
this.matrix.scaleX = finalScaleX;
|
|
49474
49473
|
this.matrix.scaleY = finalScaleY;
|
|
49475
49474
|
this.subject.publish(this);
|
|
49476
49475
|
return;
|
|
49477
49476
|
}
|
|
49478
49477
|
this.animateLocalToTarget({
|
|
49479
|
-
translateX:
|
|
49480
|
-
translateY:
|
|
49478
|
+
translateX: finalTranslateX,
|
|
49479
|
+
translateY: finalTranslateY,
|
|
49481
49480
|
scaleX: finalScaleX,
|
|
49482
49481
|
scaleY: finalScaleY
|
|
49483
49482
|
});
|
package/dist/cjs/node.js
CHANGED
|
@@ -51925,32 +51925,31 @@ class Camera {
|
|
|
51925
51925
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
51926
51926
|
}
|
|
51927
51927
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
51928
|
-
const
|
|
51929
|
-
const
|
|
51930
|
-
const
|
|
51931
|
-
const
|
|
51928
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
51929
|
+
const startScaleX = base3.scaleX;
|
|
51930
|
+
const startScaleY = base3.scaleY;
|
|
51931
|
+
const startTranslateX = base3.translateX;
|
|
51932
|
+
const startTranslateY = base3.translateY;
|
|
51932
51933
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
51933
51934
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
51934
|
-
const
|
|
51935
|
-
const
|
|
51936
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
51937
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
51938
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
51939
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
51935
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
51936
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
51940
51937
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
51941
51938
|
return;
|
|
51942
51939
|
}
|
|
51940
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
51941
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
51943
51942
|
if (duration === 0) {
|
|
51944
|
-
this.matrix.translateX =
|
|
51945
|
-
this.matrix.translateY =
|
|
51943
|
+
this.matrix.translateX = finalTranslateX;
|
|
51944
|
+
this.matrix.translateY = finalTranslateY;
|
|
51946
51945
|
this.matrix.scaleX = finalScaleX;
|
|
51947
51946
|
this.matrix.scaleY = finalScaleY;
|
|
51948
51947
|
this.subject.publish(this);
|
|
51949
51948
|
return;
|
|
51950
51949
|
}
|
|
51951
51950
|
this.animateLocalToTarget({
|
|
51952
|
-
translateX:
|
|
51953
|
-
translateY:
|
|
51951
|
+
translateX: finalTranslateX,
|
|
51952
|
+
translateY: finalTranslateY,
|
|
51954
51953
|
scaleX: finalScaleX,
|
|
51955
51954
|
scaleY: finalScaleY
|
|
51956
51955
|
});
|
package/dist/esm/browser.js
CHANGED
|
@@ -49298,32 +49298,31 @@ class Camera {
|
|
|
49298
49298
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
49299
49299
|
}
|
|
49300
49300
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
49301
|
-
const
|
|
49302
|
-
const
|
|
49303
|
-
const
|
|
49304
|
-
const
|
|
49301
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
49302
|
+
const startScaleX = base3.scaleX;
|
|
49303
|
+
const startScaleY = base3.scaleY;
|
|
49304
|
+
const startTranslateX = base3.translateX;
|
|
49305
|
+
const startTranslateY = base3.translateY;
|
|
49305
49306
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
49306
49307
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
49307
|
-
const
|
|
49308
|
-
const
|
|
49309
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
49310
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
49311
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
49312
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
49308
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
49309
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
49313
49310
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
49314
49311
|
return;
|
|
49315
49312
|
}
|
|
49313
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
49314
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
49316
49315
|
if (duration === 0) {
|
|
49317
|
-
this.matrix.translateX =
|
|
49318
|
-
this.matrix.translateY =
|
|
49316
|
+
this.matrix.translateX = finalTranslateX;
|
|
49317
|
+
this.matrix.translateY = finalTranslateY;
|
|
49319
49318
|
this.matrix.scaleX = finalScaleX;
|
|
49320
49319
|
this.matrix.scaleY = finalScaleY;
|
|
49321
49320
|
this.subject.publish(this);
|
|
49322
49321
|
return;
|
|
49323
49322
|
}
|
|
49324
49323
|
this.animateLocalToTarget({
|
|
49325
|
-
translateX:
|
|
49326
|
-
translateY:
|
|
49324
|
+
translateX: finalTranslateX,
|
|
49325
|
+
translateY: finalTranslateY,
|
|
49327
49326
|
scaleX: finalScaleX,
|
|
49328
49327
|
scaleY: finalScaleY
|
|
49329
49328
|
});
|
package/dist/esm/index.js
CHANGED
|
@@ -49291,32 +49291,31 @@ class Camera {
|
|
|
49291
49291
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
49292
49292
|
}
|
|
49293
49293
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
49294
|
-
const
|
|
49295
|
-
const
|
|
49296
|
-
const
|
|
49297
|
-
const
|
|
49294
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
49295
|
+
const startScaleX = base3.scaleX;
|
|
49296
|
+
const startScaleY = base3.scaleY;
|
|
49297
|
+
const startTranslateX = base3.translateX;
|
|
49298
|
+
const startTranslateY = base3.translateY;
|
|
49298
49299
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
49299
49300
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
49300
|
-
const
|
|
49301
|
-
const
|
|
49302
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
49303
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
49304
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
49305
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
49301
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
49302
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
49306
49303
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
49307
49304
|
return;
|
|
49308
49305
|
}
|
|
49306
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
49307
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
49309
49308
|
if (duration === 0) {
|
|
49310
|
-
this.matrix.translateX =
|
|
49311
|
-
this.matrix.translateY =
|
|
49309
|
+
this.matrix.translateX = finalTranslateX;
|
|
49310
|
+
this.matrix.translateY = finalTranslateY;
|
|
49312
49311
|
this.matrix.scaleX = finalScaleX;
|
|
49313
49312
|
this.matrix.scaleY = finalScaleY;
|
|
49314
49313
|
this.subject.publish(this);
|
|
49315
49314
|
return;
|
|
49316
49315
|
}
|
|
49317
49316
|
this.animateLocalToTarget({
|
|
49318
|
-
translateX:
|
|
49319
|
-
translateY:
|
|
49317
|
+
translateX: finalTranslateX,
|
|
49318
|
+
translateY: finalTranslateY,
|
|
49320
49319
|
scaleX: finalScaleX,
|
|
49321
49320
|
scaleY: finalScaleY
|
|
49322
49321
|
});
|
package/dist/esm/node.js
CHANGED
|
@@ -51759,32 +51759,31 @@ class Camera {
|
|
|
51759
51759
|
this.zoomRelativeToPointBy(scale, this.pointer.x, this.pointer.y);
|
|
51760
51760
|
}
|
|
51761
51761
|
zoomRelativeToPointBy(scale, x, y, duration = 400) {
|
|
51762
|
-
const
|
|
51763
|
-
const
|
|
51764
|
-
const
|
|
51765
|
-
const
|
|
51762
|
+
const base3 = this.localAnimationTarget ?? this.matrix;
|
|
51763
|
+
const startScaleX = base3.scaleX;
|
|
51764
|
+
const startScaleY = base3.scaleY;
|
|
51765
|
+
const startTranslateX = base3.translateX;
|
|
51766
|
+
const startTranslateY = base3.translateY;
|
|
51766
51767
|
const boardPointX = (x - startTranslateX) / startScaleX;
|
|
51767
51768
|
const boardPointY = (y - startTranslateY) / startScaleY;
|
|
51768
|
-
const
|
|
51769
|
-
const
|
|
51770
|
-
const targetTranslateX = x - boardPointX * targetScaleX;
|
|
51771
|
-
const targetTranslateY = y - boardPointY * targetScaleY;
|
|
51772
|
-
const finalScaleX = this.limitScale(targetScaleX);
|
|
51773
|
-
const finalScaleY = this.limitScale(targetScaleY);
|
|
51769
|
+
const finalScaleX = this.limitScale(startScaleX * scale);
|
|
51770
|
+
const finalScaleY = this.limitScale(startScaleY * scale);
|
|
51774
51771
|
if (finalScaleX === startScaleX && finalScaleY === startScaleY) {
|
|
51775
51772
|
return;
|
|
51776
51773
|
}
|
|
51774
|
+
const finalTranslateX = x - boardPointX * finalScaleX;
|
|
51775
|
+
const finalTranslateY = y - boardPointY * finalScaleY;
|
|
51777
51776
|
if (duration === 0) {
|
|
51778
|
-
this.matrix.translateX =
|
|
51779
|
-
this.matrix.translateY =
|
|
51777
|
+
this.matrix.translateX = finalTranslateX;
|
|
51778
|
+
this.matrix.translateY = finalTranslateY;
|
|
51780
51779
|
this.matrix.scaleX = finalScaleX;
|
|
51781
51780
|
this.matrix.scaleY = finalScaleY;
|
|
51782
51781
|
this.subject.publish(this);
|
|
51783
51782
|
return;
|
|
51784
51783
|
}
|
|
51785
51784
|
this.animateLocalToTarget({
|
|
51786
|
-
translateX:
|
|
51787
|
-
translateY:
|
|
51785
|
+
translateX: finalTranslateX,
|
|
51786
|
+
translateY: finalTranslateY,
|
|
51788
51787
|
scaleX: finalScaleX,
|
|
51789
51788
|
scaleY: finalScaleY
|
|
51790
51789
|
});
|