@kitware/vtk.js 24.16.4 → 24.16.7

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.
@@ -132,11 +132,7 @@ function vtkOBBTree(publicAPI, model) {
132
132
 
133
133
  for (var _i2 = 0; _i2 < 3; _i2++) {
134
134
  for (var _j2 = 0; _j2 < 3; _j2++) {
135
- a[_i2][_j2] = a[_i2][_j2] / totMass - mean[_i2] * mean[_j2]; // send to zero if close to zero
136
-
137
- if (Math.abs(a[_i2][_j2]) < 1e-12) {
138
- a[_i2][_j2] = 0;
139
- }
135
+ a[_i2][_j2] = a[_i2][_j2] / totMass - mean[_i2] * mean[_j2];
140
136
  }
141
137
  } //
142
138
  // Extract axes (i.e., eigenvectors) from covariance matrix.
@@ -199,7 +199,10 @@ function vtkMouseRangeManipulator(publicAPI, model) {
199
199
  // and the last `onMouseMove` event, we must make sure the pointer
200
200
  // is still locked before we run this logic otherwise we may
201
201
  // get a `onMouseMove` call after the pointer has been unlocked.
202
- if (!interactor.isPointerLocked()) return;
202
+ if (!interactor.isPointerLocked()) return; // previousPosition could be undefined if for some reason the
203
+ // `startPointerLockEvent` method is called before the `onButtonDown` one.
204
+
205
+ if (model.previousPosition == null) return;
203
206
  model.previousPosition.x += event.movementX;
204
207
  model.previousPosition.y += event.movementY;
205
208
  publicAPI.onMouseMove(interactor, renderer, model.previousPosition);
@@ -67,7 +67,7 @@ function vtkWebGPURenderWindow(publicAPI, model) {
67
67
  publicAPI.recreateSwapChain = function () {
68
68
  if (model.context) {
69
69
  model.context.unconfigure();
70
- var presentationFormat = model.context.getPreferredFormat(model.adapter);
70
+ var presentationFormat = navigator.gpu.getPreferredCanvasFormat(model.adapter);
71
71
  /* eslint-disable no-undef */
72
72
 
73
73
  /* eslint-disable no-bitwise */
@@ -75,8 +75,10 @@ function vtkWebGPURenderWindow(publicAPI, model) {
75
75
  model.context.configure({
76
76
  device: model.device.getHandle(),
77
77
  format: presentationFormat,
78
+ alphaMode: 'premultiplied',
78
79
  usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_DST,
79
- size: model.size
80
+ width: model.size[0],
81
+ height: model.size[1]
80
82
  });
81
83
  model._configured = true;
82
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "24.16.4",
3
+ "version": "24.16.7",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",