@tldraw/editor 5.5.0-canary.a6f7d6248c5f → 5.5.0-next.39dacfbc1ff1

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/index.js CHANGED
@@ -392,7 +392,7 @@ var import_uniq = require("./lib/utils/uniq");
392
392
  var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
393
393
  (0, import_utils.registerTldrawLibraryVersion)(
394
394
  "@tldraw/editor",
395
- "5.5.0-canary.a6f7d6248c5f",
395
+ "5.5.0-next.39dacfbc1ff1",
396
396
  "cjs"
397
397
  );
398
398
  //# sourceMappingURL=index.js.map
@@ -2498,16 +2498,14 @@ class Editor extends import_eventemitter3.default {
2498
2498
  setCamera(point, opts) {
2499
2499
  const { isLocked } = this._cameraOptions.__unsafe__getWithoutCapture();
2500
2500
  if (isLocked && !opts?.force) return this;
2501
- const _point = import_Vec.Vec.Cast(point);
2502
- if (!Number.isFinite(_point.x) || !Number.isFinite(_point.y) || !Number.isFinite(_point.z)) {
2503
- throw Error(
2504
- `Editor.setCamera: expected finite values, got (${_point.x}, ${_point.y}, ${_point.z}).`
2505
- );
2506
- }
2507
2501
  this.stopCameraAnimation();
2508
2502
  if (this.getInstanceState().followingUserId) {
2509
2503
  this.stopFollowingUser();
2510
2504
  }
2505
+ const _point = import_Vec.Vec.Cast(point);
2506
+ if (!Number.isFinite(_point.x)) _point.x = 0;
2507
+ if (!Number.isFinite(_point.y)) _point.y = 0;
2508
+ if (_point.z === void 0 || !Number.isFinite(_point.z)) point.z = this.getZoomLevel();
2511
2509
  const camera = this.getConstrainedCamera(_point, opts);
2512
2510
  if (opts?.animation) {
2513
2511
  const { width, height } = this.getViewportScreenBounds();