mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2024-11-12 21:10:04 +00:00
Fix mouse coordinates
This commit is contained in:
parent
139681a3fd
commit
e402b5f5a3
@ -800,7 +800,7 @@ namespace glerminal
|
||||
{
|
||||
glerminal* const self = static_cast<glerminal*>(glfwGetWindowUserPointer(window));
|
||||
|
||||
if (self->m_mousemoved) { self->m_mousemoved(x / CELL_SIZE, y / CELL_SIZE); }
|
||||
if (self->m_mousemoved) { self->m_mousemoved(x / (CELL_SIZE * CELL_SCALE), y / (CELL_SIZE * CELL_SCALE)); }
|
||||
}
|
||||
|
||||
void glerminal::glfw_mousepress_handler(GLFWwindow *window, int button, int action, int mods)
|
||||
@ -812,12 +812,12 @@ namespace glerminal
|
||||
|
||||
if (self->m_mousepressed && action == GLFW_PRESS)
|
||||
{
|
||||
self->m_mousepressed(button, x / CELL_SIZE, y / CELL_SIZE);
|
||||
self->m_mousepressed(button, x / (CELL_SIZE * CELL_SCALE), y / (CELL_SIZE * CELL_SCALE));
|
||||
}
|
||||
|
||||
if (self->m_mousereleased && action == GLFW_RELEASE)
|
||||
{
|
||||
self->m_mousereleased(button, x / CELL_SIZE, y / CELL_SIZE);
|
||||
self->m_mousereleased(button, x / (CELL_SIZE * CELL_SCALE), y / (CELL_SIZE * CELL_SCALE));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user