@deck.gl/core 9.2.8 → 9.2.10

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
@@ -232,7 +232,7 @@ var json_loader_default = {
232
232
 
233
233
  // dist/lib/init.js
234
234
  function checkVersion() {
235
- const version = true ? "9.2.8" : globalThis.DECK_VERSION || "untranspiled source";
235
+ const version = true ? "9.2.10" : globalThis.DECK_VERSION || "untranspiled source";
236
236
  const existingVersion = globalThis.deck && globalThis.deck.VERSION;
237
237
  if (existingVersion && existingVersion !== version) {
238
238
  throw new Error(`deck.gl - multiple versions detected: ${existingVersion} vs ${version}`);
@@ -12394,7 +12394,7 @@ var OrbitState = class extends ViewState {
12394
12394
  let { startZoom, startZoomPosition } = this.getState();
12395
12395
  if (!startZoomPosition) {
12396
12396
  startZoom = this.getViewportProps().zoom;
12397
- startZoomPosition = this._unproject(startPos) || this._unproject(pos);
12397
+ startZoomPosition = this._unproject(startPos || pos);
12398
12398
  }
12399
12399
  if (!startZoomPosition) {
12400
12400
  return this;
@@ -12459,9 +12459,13 @@ var OrbitState = class extends ViewState {
12459
12459
  });
12460
12460
  }
12461
12461
  /* Private methods */
12462
+ _project(pos) {
12463
+ const viewport = this.makeViewport(this.getViewportProps());
12464
+ return viewport.project(pos);
12465
+ }
12462
12466
  _unproject(pos) {
12463
12467
  const viewport = this.makeViewport(this.getViewportProps());
12464
- return pos && viewport.unproject(pos);
12468
+ return viewport.unproject(pos);
12465
12469
  }
12466
12470
  // Calculates new zoom
12467
12471
  _calculateNewZoom({ scale, startZoom }) {
@@ -12473,10 +12477,11 @@ var OrbitState = class extends ViewState {
12473
12477
  return (0, import_core27.clamp)(zoom, minZoom, maxZoom);
12474
12478
  }
12475
12479
  _panFromCenter(offset) {
12476
- const { width, height, target } = this.getViewportProps();
12480
+ const { target } = this.getViewportProps();
12481
+ const center = this._project(target);
12477
12482
  return this.pan({
12478
12483
  startPosition: target,
12479
- pos: [width / 2 + offset[0], height / 2 + offset[1]]
12484
+ pos: [center[0] + offset[0], center[1] + offset[1]]
12480
12485
  });
12481
12486
  }
12482
12487
  _getUpdatedState(newProps) {