From f2762a05d175a402c868d1059106b4082de4c348 Mon Sep 17 00:00:00 2001 From: Darby Johnston Date: Mon, 22 May 2023 14:58:43 -0700 Subject: [PATCH] Cursor fix --- lib/tlGLFWApp/IApp.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/tlGLFWApp/IApp.cpp b/lib/tlGLFWApp/IApp.cpp index 18861bbe6..18fcd1848 100644 --- a/lib/tlGLFWApp/IApp.cpp +++ b/lib/tlGLFWApp/IApp.cpp @@ -397,7 +397,16 @@ namespace tl void IApp::_cursorPosCallback(GLFWwindow* glfwWindow, double x, double y) { IApp* app = reinterpret_cast(glfwGetWindowUserPointer(glfwWindow)); - app->_p->eventLoop->cursorPos(math::Vector2i(x, y)); + math::Vector2i pos; +#if defined(__APPLE__) + //! \bug The mouse position needs to be scaled on macOS? + pos.x = x * app->_p->contentScale.x; + pos.y = y * app->_p->contentScale.y; +#else // __APPLE__ + pos.x = x; + pos.y = y; +#endif // __APPLE__ + app->_p->eventLoop->cursorPos(pos); } void IApp::_mouseButtonCallback(GLFWwindow* glfwWindow, int button, int action, int mods)