Commit 5a8f26e3 authored by Sebastien Jourdain's avatar Sebastien Jourdain Committed by Code Review

Merge topic 'java-mousewheel' into master

aef8403d In java code, handle situation when wheel rotation value is zero.
parents 8987514f aef8403d
......@@ -299,11 +299,14 @@ public class vtkInteractorForwarder implements MouseListener, MouseMotionListene
lastY = e.getY();
ctrlPressed = (e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK ? 1 : 0;
shiftPressed = (e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK ? 1 : 0;
component.getRenderWindowInteractor().SetEventInformationFlipY(lastX, lastY, ctrlPressed, shiftPressed, '0', 0, "0");
if (e.getWheelRotation() > 0)
if (e.getWheelRotation() > 0) {
component.getRenderWindowInteractor().SetEventInformationFlipY(lastX, lastY, ctrlPressed, shiftPressed, '0', 0, "0");
component.getRenderWindowInteractor().MouseWheelBackwardEvent();
else
}
else if (e.getWheelRotation() < 0) {
component.getRenderWindowInteractor().SetEventInformationFlipY(lastX, lastY, ctrlPressed, shiftPressed, '0', 0, "0");
component.getRenderWindowInteractor().MouseWheelForwardEvent();
}
} catch (InterruptedException interupt) {
// Nothing to do
} finally {
......
......@@ -243,13 +243,15 @@ public class vtkCanvas extends vtkPanel implements MouseListener, MouseMotionLis
ctrlPressed = (e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK ? 1 : 0;
shiftPressed = (e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK ? 1 : 0;
iren.SetEventInformationFlipY(e.getX(), e.getY(), ctrlPressed, shiftPressed, '0', 0, "0");
Lock();
if (e.getWheelRotation() > 0)
if (e.getWheelRotation() > 0) {
iren.SetEventInformationFlipY(e.getX(), e.getY(), ctrlPressed, shiftPressed, '0', 0, "0");
iren.MouseWheelBackwardEvent();
else
}
else if (e.getWheelRotation() < 0) {
iren.SetEventInformationFlipY(e.getX(), e.getY(), ctrlPressed, shiftPressed, '0', 0, "0");
iren.MouseWheelForwardEvent();
}
UnLock();
UpdateLight();
......
......@@ -336,7 +336,7 @@ public class vtkPanel extends Canvas implements MouseListener, MouseMotionListen
}
public void mouseWheelMoved(MouseWheelEvent e) {
if (ren.VisibleActorCount() == 0)
if (ren.VisibleActorCount() == 0 || e.getWheelRotation() == 0)
return;
int exponent;
exponent = -10 * e.getWheelRotation() / Math.abs(e.getWheelRotation());
......
......@@ -90,13 +90,15 @@ public class vtkRenderWindowPanel extends vtkCanvas {
ctrlPressed = (e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK ? 1 : 0;
shiftPressed = (e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK ? 1 : 0;
iren.SetEventInformationFlipY(e.getX(), e.getY(), ctrlPressed, shiftPressed, '0', 0, "0");
Lock();
if (e.getWheelRotation() > 0)
if (e.getWheelRotation() > 0) {
iren.SetEventInformationFlipY(e.getX(), e.getY(), ctrlPressed, shiftPressed, '0', 0, "0");
iren.MouseWheelBackwardEvent();
else
}
else if (e.getWheelRotation() < 0) {
iren.SetEventInformationFlipY(e.getX(), e.getY(), ctrlPressed, shiftPressed, '0', 0, "0");
iren.MouseWheelForwardEvent();
}
UnLock();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment