@ibodr/editor 0.2.20 → 0.2.23
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.mjs +9 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -18082,6 +18082,9 @@ var Editor = class extends EventEmitter {
|
|
|
18082
18082
|
_setCamera(point, opts) {
|
|
18083
18083
|
const currentCamera = this.getCamera();
|
|
18084
18084
|
const { x, y, z } = this.getConstrainedCamera(point, opts);
|
|
18085
|
+
if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z)) {
|
|
18086
|
+
return this;
|
|
18087
|
+
}
|
|
18085
18088
|
if (currentCamera.x === x && currentCamera.y === y && currentCamera.z === z) {
|
|
18086
18089
|
return this;
|
|
18087
18090
|
}
|
|
@@ -18167,7 +18170,11 @@ var Editor = class extends EventEmitter {
|
|
|
18167
18170
|
const { isLocked } = this.getCameraOptions();
|
|
18168
18171
|
if (isLocked && !opts?.force) return this;
|
|
18169
18172
|
const { width: pw, height: ph } = this.getViewportPageBounds();
|
|
18170
|
-
|
|
18173
|
+
const x = -(point.x - pw / 2);
|
|
18174
|
+
const y = -(point.y - ph / 2);
|
|
18175
|
+
const z = this.getCamera().z;
|
|
18176
|
+
if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z)) return this;
|
|
18177
|
+
this.setCamera(new Vec(x, y, z), opts);
|
|
18171
18178
|
return this;
|
|
18172
18179
|
}
|
|
18173
18180
|
/**
|
|
@@ -26844,7 +26851,7 @@ function getFontsFromRichText(editor, richText, initialState2) {
|
|
|
26844
26851
|
// src/index.ts
|
|
26845
26852
|
registerDrawLibraryVersion(
|
|
26846
26853
|
"@ibodr/editor",
|
|
26847
|
-
"0.2.
|
|
26854
|
+
"0.2.23",
|
|
26848
26855
|
"esm"
|
|
26849
26856
|
);
|
|
26850
26857
|
/*!
|