From aa53900fa3a3b38809d8eee70d30b8172e4436f7 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 15 Dec 2015 15:40:50 -0800 Subject: [PATCH] CR feedback --- interface/src/Application.cpp | 22 +++++++--------------- interface/src/Application.h | 3 --- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 7294350d44..8ec5506f21 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -664,7 +664,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : auto userInputMapper = DependencyManager::get(); connect(userInputMapper.data(), &UserInputMapper::actionEvent, [this](int action, float state) { if (action == controller::toInt(controller::Action::RETICLE_CLICK)) { - auto globalPos = getReticlePosition(); + auto globalPos = QCursor::pos(); auto localPos = _glWidget->mapFromGlobal(globalPos); if (state) { QMouseEvent mousePress(QEvent::MouseButtonPress, localPos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); @@ -686,13 +686,13 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : } else if (action == controller::toInt(controller::Action::CONTEXT_MENU)) { VrMenu::toggle(); // show context menu even on non-stereo displays } else if (action == controller::toInt(controller::Action::RETICLE_X)) { - auto reticlePos = getReticlePosition(); - reticlePos.setX(reticlePos.x() + state); - setReticlePosition(reticlePos); + auto globalPos = QCursor::pos(); + globalPos.setX(globalPos.x() + state); + QCursor::setPos(globalPos); } else if (action == controller::toInt(controller::Action::RETICLE_Y)) { - auto reticlePos = getReticlePosition(); - reticlePos.setY(reticlePos.y() + state); - setReticlePosition(reticlePos); + auto globalPos = QCursor::pos(); + globalPos.setY(globalPos.y() + state); + QCursor::setPos(globalPos); } } }); @@ -4753,14 +4753,6 @@ bool Application::isThrottleRendering() const { return getActiveDisplayPlugin()->isThrottled(); } -QPoint Application::getReticlePosition() const { - return QCursor::pos(); -} - -void Application::setReticlePosition(QPoint position) { - QCursor::setPos(position); -} - ivec2 Application::getTrueMouse() const { return toGlm(_glWidget->mapFromGlobal(QCursor::pos())); } diff --git a/interface/src/Application.h b/interface/src/Application.h index 6c9dd1db47..a665e925a9 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -143,9 +143,6 @@ public: EntityTreeRenderer* getEntityClipboardRenderer() { return &_entityClipboardRenderer; } EntityEditPacketSender* getEntityEditPacketSender() { return &_entityEditSender; } - QPoint getReticlePosition() const; - void setReticlePosition(QPoint position); - ivec2 getMouse() const; ivec2 getTrueMouse() const;