From e402b5f5a36cd6261a6dedc8ba43f77b133073c0 Mon Sep 17 00:00:00 2001 From: Shylie Date: Thu, 13 Jun 2024 18:08:02 -0400 Subject: [PATCH] Fix mouse coordinates --- source/glerminal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/glerminal.cpp b/source/glerminal.cpp index b7c4c36..4e9e5f9 100644 --- a/source/glerminal.cpp +++ b/source/glerminal.cpp @@ -800,7 +800,7 @@ namespace glerminal { glerminal* const self = static_cast(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)); } }