MCPcopy Create free account
hub / github.com/MITK/MITK / GetMousePosition

Method GetMousePosition

Modules/QtWidgets/src/QmitkRenderWindow.cpp:326–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326mitk::Point2D QmitkRenderWindow::GetMousePosition(QMouseEvent *me) const
327{
328 mitk::Point2D point;
329 const auto scale = this->devicePixelRatioF();
330 const auto position = me->position();
331 point[0] = position.x()*scale;
332 // We need to convert the y component, as the display and vtk have other definitions for the y direction
333 point[1] = m_Renderer->GetSizeY() - position.y()*scale;
334 return point;
335}
336
337mitk::Point2D QmitkRenderWindow::GetMousePosition(QWheelEvent *we) const
338{

Callers 1

eventMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected