Commit 790c9a2e authored by Marcus D. Hanwell's avatar Marcus D. Hanwell

Initialize unused variables when setting event

The vtkContextMouseEvent object isn't really designed to be used
outside of the mouse events/interactors. When using them all variables
should be set. Ensure positions that happen to not be used in this
particular test are initialized (this is all normally taken care of
when real mouse events are received).

Change-Id: I12ba843845e42dddb7e2ddb5ef05492b79f10786
parent e80552e6
......@@ -69,6 +69,11 @@ int TestZoomAxis(int, char * [])
// Inject some mouse events to perform zooming
vtkContextMouseEvent event;
event.SetLastPos(vtkVector2f(0.0f));
event.SetPos(vtkVector2f(0.0f));
event.SetLastScenePos(vtkVector2f(0.0f));
event.SetScenePos(vtkVector2f(0.0f));
event.SetLastScreenPos(vtkVector2i(0));
event.SetInteractor(view->GetInteractor());
event.SetButton(vtkContextMouseEvent::LEFT_BUTTON);
event.SetScreenPos(vtkVector2i(350, 250));
......@@ -76,9 +81,6 @@ int TestZoomAxis(int, char * [])
event.SetLastScreenPos(event.GetScreenPos());
event.SetScreenPos(vtkVector2i(10, 10));
chart->MouseMoveEvent(event);
//event.SetLastScreenPos(event.GetScreenPos());
//event.SetScreenPos(vtkVector2i(180, 150));
//chart->MouseMoveEvent(event);
chart->MouseButtonReleaseEvent(event);
//Finally render the scene and compare the image to a reference image
......
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