Skip to content

Commit 2286a95

Browse files
committed
chore(InteractorStyleMPRSlice): fix recursion error in example
Limit slice widget update in example to prevent recursion error between the controller and interactor style
1 parent 96f6ef3 commit 2286a95

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • Sources/Interaction/Style/InteractorStyleMPRSlice

Sources/Interaction/Style/InteractorStyleMPRSlice/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ function vtkInteractorStyleMPRSlice(publicAPI, model) {
137137
};
138138

139139
publicAPI.setSlice = (slice) => {
140+
if (publicAPI.getSlice() === slice) {
141+
return false;
142+
}
140143
const renderer = model._interactor.getCurrentRenderer();
141144
const camera = renderer.getActiveCamera();
142145

@@ -171,6 +174,7 @@ function vtkInteractorStyleMPRSlice(publicAPI, model) {
171174
camera.setPosition(...newPos);
172175
camera.setFocalPoint(...slicePoint);
173176
}
177+
return true;
174178
};
175179

176180
publicAPI.getSliceRange = () => {

0 commit comments

Comments
 (0)