Fixes for UI editor changes
This commit is contained in:
@@ -21,9 +21,12 @@ namespace FlaxEditor
|
||||
|
||||
public void ShowActors(IEnumerable<Actor> actors)
|
||||
{
|
||||
var root = UIEditor.UIRoot;
|
||||
if (root == null)
|
||||
return;
|
||||
|
||||
// Calculate bounds of all selected objects
|
||||
var areaRect = Rectangle.Empty;
|
||||
var root = UIEditor.UIRoot;
|
||||
foreach (var actor in actors)
|
||||
{
|
||||
Rectangle bounds;
|
||||
@@ -163,7 +166,7 @@ namespace FlaxEditor
|
||||
/// <summary>
|
||||
/// True if enable panning and zooming the view.
|
||||
/// </summary>
|
||||
public bool EnableCamera => _view != null;
|
||||
public bool EnableCamera => _view != null && EnableBackground;
|
||||
|
||||
/// <summary>
|
||||
/// Transform gizmo to use sync with (selection, snapping, transformation settings).
|
||||
@@ -293,7 +296,7 @@ namespace FlaxEditor
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return Focus(this);
|
||||
}
|
||||
|
||||
public override void OnMouseMove(Float2 location)
|
||||
@@ -467,7 +470,7 @@ namespace FlaxEditor
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
if (EnableBackground)
|
||||
if (EnableBackground && _view != null)
|
||||
{
|
||||
// Draw background
|
||||
Surface.VisjectSurface.DrawBackgroundDefault(Editor.Instance.UI.VisjectSurfaceBackground, Width, Height);
|
||||
|
||||
@@ -1537,7 +1537,7 @@ namespace FlaxEditor.Viewport
|
||||
}
|
||||
bool useMouse = IsControllingMouse || (Mathf.IsInRange(_viewMousePos.X, 0, Width) && Mathf.IsInRange(_viewMousePos.Y, 0, Height));
|
||||
_prevInput = _input;
|
||||
var hit = GetChildAt(_viewMousePos, c => c.Visible && !(c is CanvasRootControl));
|
||||
var hit = GetChildAt(_viewMousePos, c => c.Visible && !(c is CanvasRootControl) && !(c is UIEditorRoot));
|
||||
if (canUseInput && ContainsFocus && hit == null)
|
||||
_input.Gather(win.Window, useMouse);
|
||||
else
|
||||
|
||||
@@ -114,6 +114,8 @@ namespace FlaxEditor.Viewport.Previews
|
||||
_uiControlLinked = uiControl;
|
||||
_hasUILinked = true;
|
||||
}
|
||||
else if (_uiControlLinked != null)
|
||||
_hasUILinked = true;
|
||||
}
|
||||
|
||||
private void LinkCanvas(Actor actor)
|
||||
|
||||
Reference in New Issue
Block a user