Skip to content

Commit 357f038

Browse files
author
Alexis Girault
committed
fix(InteractorStyleManipulator): properly register animation requesters
Do not use same key for animations due to mouse drag and due to mouse wheel or the second event will not be registered as an animation requester, and the animation will stop when the first event terminates.
1 parent df20084 commit 357f038

File tree

2 files changed

+5
-4
lines changed
  • Sources
    • Interaction/Style/InteractorStyleManipulator
    • Rendering/Core/RenderWindowInteractor

2 files changed

+5
-4
lines changed

Sources/Interaction/Style/InteractorStyleManipulator/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ function vtkInteractorStyleManipulator(publicAPI, model) {
285285
callData.pokedRenderer,
286286
callData.position
287287
);
288-
model.interactor.requestAnimation(publicAPI);
288+
model.interactor.requestAnimation(publicAPI.onButtonDown);
289289
publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);
290290
} else {
291291
vtkDebugMacro('No manipulator found');
@@ -353,7 +353,7 @@ function vtkInteractorStyleManipulator(publicAPI, model) {
353353
model.currentManipulator.onButtonUp(model.interactor);
354354
model.currentManipulator.endInteraction();
355355
model.currentManipulator = null;
356-
model.interactor.cancelAnimation(publicAPI);
356+
model.interactor.cancelAnimation(publicAPI.onButtonDown);
357357
publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);
358358
}
359359
};
@@ -368,7 +368,7 @@ function vtkInteractorStyleManipulator(publicAPI, model) {
368368
manipulator.startInteraction();
369369
}
370370
}
371-
model.interactor.requestAnimation(publicAPI);
371+
model.interactor.requestAnimation(publicAPI.handleStartMouseWheel);
372372
publicAPI.invokeStartInteractionEvent(START_INTERACTION_EVENT);
373373
};
374374

@@ -382,7 +382,7 @@ function vtkInteractorStyleManipulator(publicAPI, model) {
382382
manipulator.endInteraction();
383383
}
384384
}
385-
model.interactor.cancelAnimation(publicAPI);
385+
model.interactor.cancelAnimation(publicAPI.handleStartMouseWheel);
386386
publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);
387387
};
388388

Sources/Rendering/Core/RenderWindowInteractor/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ function vtkRenderWindowInteractor(publicAPI, model) {
269269
return;
270270
}
271271
if (animationRequesters.has(requestor)) {
272+
vtkWarningMacro(`requester is already registered for animating`);
272273
return;
273274
}
274275
animationRequesters.add(requestor);

0 commit comments

Comments
 (0)