refactor(app): remove redundant ImGui WantCaptureMouse check in cursor callback

This commit is contained in:
2026-07-14 15:38:47 +08:00
parent 618d3f1294
commit 279f6162b8

View File

@@ -23,12 +23,10 @@ App::App()
App::~App() {} App::~App() {}
void App::cursor_position_callback(GLFWwindow* window, double xpos, void App::cursor_position_callback(GLFWwindow* window, double xpos,
double ypos) { double ypos) {
ImGuiIO& io = ImGui::GetIO();
App* app = static_cast<App*>(glfwGetWindowUserPointer(window)); App* app = static_cast<App*>(glfwGetWindowUserPointer(window));
ASSERT_MSG(app, "nullptr"); ASSERT_MSG(app, "nullptr");
if (io.WantCaptureMouse && app->m_window.is_enable_imgui()) { if (app->m_window.is_enable_imgui()) {
ImGui_ImplGlfw_CursorPosCallback(window, xpos, ypos); ImGui_ImplGlfw_CursorPosCallback(window, xpos, ypos);
return; return;
} }