fixed unselecting entity when cursor goes from ImGui to viewport while click is held

This commit is contained in:
Erris
2026-03-03 09:38:52 +01:00
parent 4a624cfe70
commit 282eeeabda
4 changed files with 7 additions and 15 deletions

View File

@@ -3,9 +3,6 @@
#include <open_engine.hpp>
#include "open_engine/renderer/renderer3d.hpp"
#include "open_engine/scene/components.hpp"
#include "open_engine/scene/scene_serializer.hpp"
#include "panels/content_browser.hpp"
#include "panels/scene_hierarchy.hpp"
@@ -181,7 +178,6 @@ namespace OpenEngine {
RenderCommand::Clear();
framebuffer->ClearBufferI(1, -1);
switch (state) {
case PlayState::Play: {
scene->OnUpdateRuntime();
@@ -208,6 +204,7 @@ namespace OpenEngine {
static bool clicked = false;
// Mouse Picking
if (Input::IsMouseButtonPressed(MouseCode::ButtonLeft)
&& !Application::Get().GetImGuiLayer()->GetBlockEvents()
&& mouse_x >= 0 && mouse_y >= 0
&& mouse_x < (int)viewport_size.x
&& mouse_y < (int)viewport_size.y