@kitware/vtk.js 26.1.2 → 26.1.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.
@@ -758,7 +758,10 @@ function vtkOpenGLTexture(publicAPI, model) {
758
758
 
759
759
  if (model._openGLRenderWindow.getWebgl2()) {
760
760
  model.context.texStorage2D(model.target, 1, model.internalFormat, model.width, model.height);
761
- model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, scaledData[0]);
761
+
762
+ if (scaledData[0] != null) {
763
+ model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, scaledData[0]);
764
+ }
762
765
  } else {
763
766
  model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, scaledData[0]);
764
767
  }
@@ -849,7 +852,9 @@ function vtkOpenGLTexture(publicAPI, model) {
849
852
  }
850
853
 
851
854
  if (model._openGLRenderWindow.getWebgl2()) {
852
- model.context.texSubImage2D(model.context.TEXTURE_CUBE_MAP_POSITIVE_X + _i3, j, 0, 0, w, h, model.format, model.openGLDataType, tempData);
855
+ if (tempData != null) {
856
+ model.context.texSubImage2D(model.context.TEXTURE_CUBE_MAP_POSITIVE_X + _i3, j, 0, 0, w, h, model.format, model.openGLDataType, tempData);
857
+ }
853
858
  } else {
854
859
  model.context.texImage2D(model.context.TEXTURE_CUBE_MAP_POSITIVE_X + _i3, j, model.internalFormat, w, h, 0, model.format, model.openGLDataType, tempData);
855
860
  }
@@ -904,7 +909,10 @@ function vtkOpenGLTexture(publicAPI, model) {
904
909
 
905
910
  if (model._openGLRenderWindow.getWebgl2()) {
906
911
  model.context.texStorage2D(model.target, 1, model.internalFormat, model.width, model.height);
907
- model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, data);
912
+
913
+ if (data != null) {
914
+ model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, data);
915
+ }
908
916
  } else {
909
917
  model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, data);
910
918
  }
@@ -956,7 +964,10 @@ function vtkOpenGLTexture(publicAPI, model) {
956
964
 
957
965
  if (model._openGLRenderWindow.getWebgl2()) {
958
966
  model.context.texStorage2D(model.target, 1, model.internalFormat, model.width, model.height);
959
- model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, safeImage);
967
+
968
+ if (safeImage != null) {
969
+ model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, safeImage);
970
+ }
960
971
  } else {
961
972
  model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, safeImage);
962
973
  }
@@ -1088,7 +1099,10 @@ function vtkOpenGLTexture(publicAPI, model) {
1088
1099
 
1089
1100
  if (model._openGLRenderWindow.getWebgl2()) {
1090
1101
  model.context.texStorage3D(model.target, 1, model.internalFormat, model.width, model.height, model.depth);
1091
- model.context.texSubImage3D(model.target, 0, 0, 0, 0, model.width, model.height, model.depth, model.format, model.openGLDataType, scaledData[0]);
1102
+
1103
+ if (scaledData[0] != null) {
1104
+ model.context.texSubImage3D(model.target, 0, 0, 0, 0, model.width, model.height, model.depth, model.format, model.openGLDataType, scaledData[0]);
1105
+ }
1092
1106
  } else {
1093
1107
  model.context.texImage3D(model.target, 0, model.internalFormat, model.width, model.height, model.depth, 0, model.format, model.openGLDataType, scaledData[0]);
1094
1108
  }
@@ -1329,7 +1343,10 @@ function vtkOpenGLTexture(publicAPI, model) {
1329
1343
 
1330
1344
  if (model._openGLRenderWindow.getWebgl2()) {
1331
1345
  model.context.texStorage2D(model.target, 1, model.internalFormat, model.width, model.height);
1332
- model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, newArray);
1346
+
1347
+ if (newArray != null) {
1348
+ model.context.texSubImage2D(model.target, 0, 0, 0, model.width, model.height, model.format, model.openGLDataType, newArray);
1349
+ }
1333
1350
  } else {
1334
1351
  model.context.texImage2D(model.target, 0, model.internalFormat, model.width, model.height, 0, model.format, model.openGLDataType, newArray);
1335
1352
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "26.1.2",
3
+ "version": "26.1.3",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",