deck.gl 9.2.2 → 9.2.4

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.
Files changed (3) hide show
  1. package/dist/dist.dev.js +21 -19
  2. package/dist.min.js +61 -61
  3. package/package.json +15 -15
package/dist/dist.dev.js CHANGED
@@ -43033,9 +43033,10 @@ void main() {
43033
43033
  onRenderHTML(rootElement) {
43034
43034
  }
43035
43035
  onViewportChange(viewport) {
43036
- if (this.isVisible && viewport.id === this.lastViewport?.id && viewport !== this.lastViewport) {
43036
+ if (this.isVisible && viewport.id === this.lastViewport?.id && !viewport.equals(this.lastViewport)) {
43037
43037
  this.setTooltip(null);
43038
43038
  }
43039
+ this.lastViewport = viewport;
43039
43040
  }
43040
43041
  onHover(info) {
43041
43042
  const { deck } = this;
@@ -43044,7 +43045,6 @@ void main() {
43044
43045
  return;
43045
43046
  }
43046
43047
  const displayInfo = getTooltip(info);
43047
- this.lastViewport = info.viewport;
43048
43048
  this.setTooltip(displayInfo, info.x, info.y);
43049
43049
  }
43050
43050
  setTooltip(displayInfo, x4, y5) {
@@ -43274,7 +43274,17 @@ void main() {
43274
43274
  if (props.gl instanceof WebGLRenderingContext) {
43275
43275
  log_default.error("WebGL1 context not supported.")();
43276
43276
  }
43277
- deviceOrPromise = webgl2Adapter.attach(props.gl, this.props.deviceProps);
43277
+ const userOnResize = this.props.deviceProps?.onResize;
43278
+ deviceOrPromise = webgl2Adapter.attach(props.gl, {
43279
+ ...this.props.deviceProps,
43280
+ onResize: (canvasContext, info) => {
43281
+ const { width, height } = canvasContext.canvas;
43282
+ canvasContext.drawingBufferWidth = width;
43283
+ canvasContext.drawingBufferHeight = height;
43284
+ this._needsRedraw = "Canvas resized";
43285
+ userOnResize?.(canvasContext, info);
43286
+ }
43287
+ });
43278
43288
  }
43279
43289
  if (!deviceOrPromise) {
43280
43290
  deviceOrPromise = this._createDevice(props);
@@ -43345,18 +43355,8 @@ void main() {
43345
43355
  this.animationLoop.start();
43346
43356
  }
43347
43357
  this.animationLoop?.setProps(resolvedProps);
43348
- if (props.useDevicePixels !== void 0 && this.device?.canvasContext?.canvas instanceof HTMLCanvasElement) {
43349
- this.device.canvasContext.props.useDevicePixels = props.useDevicePixels;
43350
- const canvas2 = this.device.canvasContext.canvas;
43351
- const entry = {
43352
- target: canvas2,
43353
- contentBoxSize: [{ inlineSize: canvas2.clientWidth, blockSize: canvas2.clientHeight }],
43354
- devicePixelContentBoxSize: [
43355
- { inlineSize: canvas2.clientWidth, blockSize: canvas2.clientHeight }
43356
- ],
43357
- borderBoxSize: [{ inlineSize: canvas2.clientWidth, blockSize: canvas2.clientHeight }]
43358
- };
43359
- this.device.canvasContext._handleResize([entry]);
43358
+ if (props.useDevicePixels !== void 0 && this.device?.canvasContext) {
43359
+ this.device.canvasContext.setProps({ useDevicePixels: props.useDevicePixels });
43360
43360
  }
43361
43361
  if (this.layerManager) {
43362
43362
  this.viewManager.setProps(resolvedProps);
@@ -43583,6 +43583,7 @@ void main() {
43583
43583
  // we must use 'premultiplied' canvas for webgpu to enable transparency and match shaders
43584
43584
  alphaMode: this.props.deviceProps?.type === "webgpu" ? "premultiplied" : void 0
43585
43585
  };
43586
+ const userOnResize = this.props.deviceProps?.onResize;
43586
43587
  return luma.createDevice({
43587
43588
  // luma by default throws if a device is already attached
43588
43589
  // asynchronous device creation could happen after finalize() is called
@@ -43598,6 +43599,10 @@ void main() {
43598
43599
  canvas: this._createCanvas(props),
43599
43600
  useDevicePixels: this.props.useDevicePixels,
43600
43601
  autoResize: true
43602
+ },
43603
+ onResize: (canvasContext, info) => {
43604
+ this._needsRedraw = "Canvas resized";
43605
+ userOnResize?.(canvasContext, info);
43601
43606
  }
43602
43607
  });
43603
43608
  }
@@ -102374,10 +102379,7 @@ void main() {
102374
102379
  deck: new Deck({
102375
102380
  ...this._props,
102376
102381
  gl,
102377
- parameters: { ...getDefaultParameters(map6, false), ...this._props.parameters },
102378
- deviceProps: {
102379
- createCanvasContext: { autoResize: true }
102380
- }
102382
+ parameters: { ...getDefaultParameters(map6, true), ...this._props.parameters }
102381
102383
  })
102382
102384
  });
102383
102385
  map6.on("styledata", this._handleStyleChange);