From e1a7614e7c1c8830a1b562836ff68c34922df2c9 Mon Sep 17 00:00:00 2001 From: Krad Date: Mon, 25 Jul 2022 16:06:40 +0800 Subject: [PATCH] Move vtkCommand::WindowLevelEvent from before windowlevel to after windowlevel. --- src/src/Interaction/ActorDraggableInteractorStyle.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/src/Interaction/ActorDraggableInteractorStyle.cpp b/src/src/Interaction/ActorDraggableInteractorStyle.cpp index 7732f8f..788d5ea 100644 --- a/src/src/Interaction/ActorDraggableInteractorStyle.cpp +++ b/src/src/Interaction/ActorDraggableInteractorStyle.cpp @@ -408,10 +408,6 @@ void ActorDraggableInteractorStyle::WindowLevel() { this->WindowLevelCurrentPosition[0] = rwi->GetEventPosition()[0]; this->WindowLevelCurrentPosition[1] = rwi->GetEventPosition()[1]; - if (this->HandleObservers && - this->HasObserver(vtkCommand::WindowLevelEvent)) { - this->InvokeEvent(vtkCommand::WindowLevelEvent, this); - } if (this->CurrentImageProperty) { int *size = this->CurrentRenderer->GetSize(); @@ -460,6 +456,10 @@ void ActorDraggableInteractorStyle::WindowLevel() { this->CurrentImageProperty->SetColorLevel(newLevel); this->Interactor->Render(); + if (this->HandleObservers && + this->HasObserver(vtkCommand::WindowLevelEvent)) { + this->InvokeEvent(vtkCommand::WindowLevelEvent, this); + } } }