Skip to content

Commit e905255

Browse files
committed
Disable edtiro scrolling/mouse actions when mouse is over UI.
1 parent bcaad8e commit e905255

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/UI/Editor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ namespace UI
128128

129129
void Editor::on_mouse_move_event(const glm::vec2 p_mouse_delta)
130130
{
131+
if (m_input.cursor_over_UI())
132+
return;
133+
131134
if (m_state == State::Editing)
132135
{
133136
if (m_input.is_mouse_down(Platform::MouseButton::Right))
@@ -147,6 +150,9 @@ namespace UI
147150
}
148151
void Editor::on_mouse_scroll_event(const glm::vec2 p_mouse_scroll)
149152
{
153+
if (m_input.cursor_over_UI())
154+
return;
155+
150156
if (m_state == State::Editing)
151157
{
152158
m_camera.zoom(p_mouse_scroll.y);

0 commit comments

Comments
 (0)