From 5e7ad3fc783d160c82ac50ece399bd1697111932 Mon Sep 17 00:00:00 2001 From: hydrogendeuteride Date: Sun, 14 Dec 2025 22:04:40 +0900 Subject: [PATCH] Edit: ImGui button-Picking interaction --- src/core/engine.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 8732058..a83d39a 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -1222,11 +1222,14 @@ void VulkanEngine::run() } if (e.type == SDL_MOUSEBUTTONDOWN && e.button.button == SDL_BUTTON_LEFT) { - _dragState.buttonDown = true; - _dragState.dragging = false; - _dragState.start = glm::vec2{static_cast(e.button.x), - static_cast(e.button.y)}; - _dragState.current = _dragState.start; + if (!ImGui::GetIO().WantCaptureMouse) + { + _dragState.buttonDown = true; + _dragState.dragging = false; + _dragState.start = glm::vec2{static_cast(e.button.x), + static_cast(e.button.y)}; + _dragState.current = _dragState.start; + } } if (e.type == SDL_MOUSEBUTTONUP && e.button.button == SDL_BUTTON_LEFT) {