Fix editor viewport input when using ScreenSpace canvas in a prefab

This commit is contained in:
Wojtek Figat
2021-04-29 16:17:40 +02:00
parent 2e5b89aa84
commit eaa5716d6a

View File

@@ -974,7 +974,8 @@ namespace FlaxEditor.Viewport
// Get input buttons and keys (skip if viewport has no focus or mouse is over a child control)
bool useMouse = Mathf.IsInRange(_viewMousePos.X, 0, Width) && Mathf.IsInRange(_viewMousePos.Y, 0, Height);
_prevInput = _input;
if (ContainsFocus && GetChildAt(_viewMousePos, c => c.Visible) == null)
var hit = GetChildAt(_viewMousePos, c => c.Visible && !(c is CanvasRootControl));
if (ContainsFocus && hit == null)
_input.Gather(win.Window, useMouse);
else
_input.Clear();