@kitware/vtk.js 31.0.1 → 31.0.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.
@@ -582,7 +582,7 @@ function vtkOpenGLRenderWindow(publicAPI, model) {
582
582
  };
583
583
  publicAPI.copyParentContent = () => {
584
584
  const rootParent = model.rootOpenGLRenderWindow;
585
- if (!rootParent || !model.context2D) {
585
+ if (!rootParent || !model.context2D || model.children.some(oglRenderer => !!oglRenderer.getSelector?.())) {
586
586
  return;
587
587
  }
588
588
  const parentCanvas = rootParent.getCanvas();
@@ -140,7 +140,7 @@ function vtkLineWidget(publicAPI, model) {
140
140
  const center = [(bounds[0] + bounds[1]) * 0.5, (bounds[2] + bounds[3]) * 0.5, (bounds[4] + bounds[5]) * 0.5];
141
141
  model.widgetState.getMoveHandle().setOrigin(center);
142
142
  });
143
- model.widgetState.getPositionOnLine().onModified(() => {
143
+ let linePosSub = model.widgetState.getPositionOnLine().onModified(() => {
144
144
  updateTextPosition(model);
145
145
  });
146
146
 
@@ -148,6 +148,10 @@ function vtkLineWidget(publicAPI, model) {
148
148
  publicAPI.setManipulator(model.manipulator || vtkPlanePointManipulator.newInstance({
149
149
  useCameraNormal: true
150
150
  }));
151
+ publicAPI.delete = macro.chain(publicAPI.delete, () => {
152
+ linePosSub.unsubscribe();
153
+ linePosSub = null;
154
+ });
151
155
  }
152
156
 
153
157
  // ----------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitware/vtk.js",
3
- "version": "31.0.1",
3
+ "version": "31.0.3",
4
4
  "description": "Visualization Toolkit for the Web",
5
5
  "keywords": [
6
6
  "3d",