@kitware/vtk.js 25.2.1 → 25.2.2

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.
@@ -518,6 +518,9 @@ function vtkRenderWindowInteractor(publicAPI, model) {
518
518
  },
519
519
  right: {
520
520
  buttons: {}
521
+ },
522
+ none: {
523
+ buttons: {}
521
524
  }
522
525
  };
523
526
  }
@@ -712,7 +715,7 @@ function vtkRenderWindowInteractor(publicAPI, model) {
712
715
  // No more fingers down
713
716
  if (pointers.length === 0) {
714
717
  var callData = _objectSpread(_objectSpread({}, getModifierKeysFor(EMPTY_MOUSE_EVENT)), {}, {
715
- position: pointers[0].position,
718
+ position: getScreenEventPositionFor(event),
716
719
  deviceType: getDeviceTypeFor(event)
717
720
  });
718
721
 
@@ -405,8 +405,6 @@ function vtkOpenGLImageMapper(publicAPI, model) {
405
405
  numClipPlanes = 6;
406
406
  }
407
407
 
408
- var image = model.currentInput;
409
- var w2imat4 = image.getWorldToIndex();
410
408
  var shiftScaleEnabled = cellBO.getCABO().getCoordShiftAndScaleEnabled();
411
409
  var inverseShiftScaleMatrix = shiftScaleEnabled ? cellBO.getCABO().getInverseShiftAndScaleMatrix() : null;
412
410
  var mat = inverseShiftScaleMatrix ? mat4.copy(model.imagematinv, actor.getMatrix()) : actor.getMatrix();
@@ -415,9 +413,11 @@ function vtkOpenGLImageMapper(publicAPI, model) {
415
413
  mat4.transpose(mat, mat);
416
414
  mat4.multiply(mat, mat, inverseShiftScaleMatrix);
417
415
  mat4.transpose(mat, mat);
418
- }
416
+ } // transform crop plane normal with transpose(inverse(worldToIndex))
417
+
419
418
 
420
- mat4.multiply(model.imagematinv, mat, w2imat4);
419
+ mat4.transpose(model.imagemat, model.currentInput.getIndexToWorld());
420
+ mat4.multiply(model.imagematinv, mat, model.imagemat);
421
421
  var planeEquations = [];
422
422
 
423
423
  for (var _i3 = 0; _i3 < numClipPlanes; _i3++) {
@@ -99,9 +99,7 @@ function vtkShaderCache(publicAPI, model) {
99
99
  var hashInput = "".concat(vertexCode).concat(fragmentCode).concat(geometryCode);
100
100
  var result = Md5.hash(hashInput); // does it already exist?
101
101
 
102
- var loc = Object.keys(model.shaderPrograms).indexOf(result);
103
-
104
- if (loc === -1) {
102
+ if (!(result in model.shaderPrograms)) {
105
103
  // create one
106
104
  var sps = vtkShaderProgram.newInstance();
107
105
  sps.setContext(model.context);
@@ -478,9 +478,7 @@ function vtkShaderProgram(publicAPI, model) {
478
478
  } // see if we have cached the result
479
479
 
480
480
 
481
- var loc = Object.keys(model.attributeLocs).indexOf(name);
482
-
483
- if (loc !== -1) {
481
+ if (name in model.attributeLocs) {
484
482
  return true;
485
483
  }
486
484
 
@@ -489,7 +487,7 @@ function vtkShaderProgram(publicAPI, model) {
489
487
  return false;
490
488
  }
491
489
 
492
- loc = model.context.getAttribLocation(model.handle, name);
490
+ var loc = model.context.getAttribLocation(model.handle, name);
493
491
 
494
492
  if (loc === -1) {
495
493
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "25.2.1",
3
+ "version": "25.2.2",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",