Skip to content

Commit

Permalink
Cursor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed May 22, 2023
1 parent 960005f commit f2762a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/tlGLFWApp/IApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,16 @@ namespace tl
void IApp::_cursorPosCallback(GLFWwindow* glfwWindow, double x, double y)
{
IApp* app = reinterpret_cast<IApp*>(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)
Expand Down

0 comments on commit f2762a0

Please sign in to comment.