@kitware/vtk.js 28.3.2 → 28.3.3

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.
@@ -264,7 +264,14 @@ function vtkDataArray(publicAPI, model) {
264
264
 
265
265
  publicAPI.getRange = function () {
266
266
  var componentIndex = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
267
- var rangeIdx = componentIndex < 0 ? model.numberOfComponents : componentIndex;
267
+ var rangeIdx = componentIndex;
268
+
269
+ if (rangeIdx < 0) {
270
+ // If scalar data, then store in slot 0 (same as componentIndex = 0).
271
+ // If vector data, then store in last slot.
272
+ rangeIdx = model.numberOfComponents === 1 ? 0 : model.numberOfComponents;
273
+ }
274
+
268
275
  var range = null;
269
276
 
270
277
  if (!model.ranges) {
@@ -743,7 +743,11 @@ function vtkOpenGLImageMapper(publicAPI, model) {
743
743
  for (var j = 0; j < dims[1]; j++) {
744
744
  var bsIdx = (sliceOffset + j * dims[0] + k * dims[0] * dims[1]) * numComp;
745
745
  id = (k * dims[1] + j) * numComp;
746
- scalars.set(basicScalars.subarray(bsIdx, bsIdx + numComp), id);
746
+ var end = bsIdx + numComp;
747
+
748
+ while (bsIdx < end) {
749
+ scalars[id++] = basicScalars[bsIdx++];
750
+ }
747
751
  }
748
752
  }
749
753
 
@@ -770,7 +774,12 @@ function vtkOpenGLImageMapper(publicAPI, model) {
770
774
  var _bsIdx = (_i9 + sliceOffset * dims[0] + _k * dims[0] * dims[1]) * numComp;
771
775
 
772
776
  _id = (_k * dims[0] + _i9) * numComp;
773
- scalars.set(basicScalars.subarray(_bsIdx, _bsIdx + numComp), _id);
777
+
778
+ var _end = _bsIdx + numComp;
779
+
780
+ while (_bsIdx < _end) {
781
+ scalars[_id++] = basicScalars[_bsIdx++];
782
+ }
774
783
  }
775
784
  }
776
785
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "28.3.2",
3
+ "version": "28.3.3",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",