Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -1166,8 +1166,7 @@ void Application::mouseMoveEvent(QMouseEvent* event, unsigned int deviceID) { · 1165 unmodified lines | ||
| 1166 | 1166 | _seenMouseMove = true; |
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | − _mouseX = event->x(); | |
| 1170 | − _mouseY = event->y(); | |
| 1169 | + setMousePosition(event, deviceID); | |
| 1171 | 1170 | } |
| 1172 | 1171 | |
| 1173 | 1172 | void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { |
| @@ -1181,8 +1180,7 @@ void Application::mousePressEvent(QMouseEvent* event, unsigned int deviceID) { · 7 unmodified lines | ||
| 1181 | 1180 | |
| 1182 | 1181 | if (activeWindow() == _window) { |
| 1183 | 1182 | if (event->button() == Qt::LeftButton) { |
| 1184 | − _mouseX = event->x(); | |
| 1185 | − _mouseY = event->y(); | |
| 1183 | + setMousePosition(event, deviceID); | |
| 1186 | 1184 | _mouseDragStartedX = _mouseX; |
| 1187 | 1185 | _mouseDragStartedY = _mouseY; |
| 1188 | 1186 | _mousePressed = true; |
| @@ -1213,8 +1211,7 @@ void Application::mouseReleaseEvent(QMouseEvent* event, unsigned int deviceID) { · 24 unmodified lines | ||
| 1213 | 1211 | |
| 1214 | 1212 | if (activeWindow() == _window) { |
| 1215 | 1213 | if (event->button() == Qt::LeftButton) { |
| 1216 | − _mouseX = event->x(); | |
| 1217 | − _mouseY = event->y(); | |
| 1214 | + setMousePosition(event, deviceID); | |
| 1218 | 1215 | _mousePressed = false; |
| 1219 | 1216 | checkBandwidthMeterClick(); |
| 1220 | 1217 | if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) { |
| @@ -2328,6 +2325,18 @@ int Application::sendNackPackets() { · 1107 unmodified lines | ||
| 2328 | 2325 | return packetsSent; |
| 2329 | 2326 | } |
| 2330 | 2327 | |
| 2328 | +void Application::setMousePosition(QMouseEvent* event, unsigned int deviceID) { | |
| 2329 | + if (deviceID > 0) { | |
| 2330 | + // simulated events are in device coordinates | |
| 2331 | + _mouseX = event->x(); | |
| 2332 | + _mouseY = event->y(); | |
| 2333 | + | |
| 2334 | + } else { | |
| 2335 | + _mouseX = _glWidget->getDeviceX(event->x()); | |
| 2336 | + _mouseY = _glWidget->getDeviceY(event->y()); | |
| 2337 | + } | |
| 2338 | +} | |
| 2339 | + | |
| 2331 | 2340 | void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { |
| 2332 | 2341 | |
| 2333 | 2342 | //qDebug() << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView(); |