Edit: ImGui button-Picking interaction

This commit is contained in:
2025-12-14 22:04:40 +09:00
parent d6ad2bf252
commit 5e7ad3fc78

View File

@@ -1221,6 +1221,8 @@ void VulkanEngine::run()
} }
} }
if (e.type == SDL_MOUSEBUTTONDOWN && e.button.button == SDL_BUTTON_LEFT) if (e.type == SDL_MOUSEBUTTONDOWN && e.button.button == SDL_BUTTON_LEFT)
{
if (!ImGui::GetIO().WantCaptureMouse)
{ {
_dragState.buttonDown = true; _dragState.buttonDown = true;
_dragState.dragging = false; _dragState.dragging = false;
@@ -1228,6 +1230,7 @@ void VulkanEngine::run()
static_cast<float>(e.button.y)}; static_cast<float>(e.button.y)};
_dragState.current = _dragState.start; _dragState.current = _dragState.start;
} }
}
if (e.type == SDL_MOUSEBUTTONUP && e.button.button == SDL_BUTTON_LEFT) if (e.type == SDL_MOUSEBUTTONUP && e.button.button == SDL_BUTTON_LEFT)
{ {
glm::vec2 releasePos{static_cast<float>(e.button.x), glm::vec2 releasePos{static_cast<float>(e.button.x),