Draw hover before selection so that way ui selection is drawn on top.
This commit is contained in:
@@ -499,6 +499,15 @@ namespace FlaxEditor
|
|||||||
bool drawAnySelectedControl = false;
|
bool drawAnySelectedControl = false;
|
||||||
var transformGizmo = TransformGizmo;
|
var transformGizmo = TransformGizmo;
|
||||||
var mousePos = PointFromWindow(RootWindow.MousePosition);
|
var mousePos = PointFromWindow(RootWindow.MousePosition);
|
||||||
|
if (EnableSelecting && !_mouseMovesControl && !_mouseMovesWidget && IsMouseOver)
|
||||||
|
{
|
||||||
|
// Highlight control under mouse for easier selecting (except if already selected)
|
||||||
|
if (RayCastControl(ref mousePos, out var hitControl) &&
|
||||||
|
(transformGizmo == null || !transformGizmo.Selection.Any(x => x.EditableObject is UIControl controlActor && controlActor.Control == hitControl)))
|
||||||
|
{
|
||||||
|
DrawControl(null, hitControl, false, ref mousePos, ref drawAnySelectedControl);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (transformGizmo != null)
|
if (transformGizmo != null)
|
||||||
{
|
{
|
||||||
// Selected UI controls outline
|
// Selected UI controls outline
|
||||||
@@ -511,15 +520,6 @@ namespace FlaxEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (EnableSelecting && !_mouseMovesControl && !_mouseMovesWidget && IsMouseOver)
|
|
||||||
{
|
|
||||||
// Highlight control under mouse for easier selecting (except if already selected)
|
|
||||||
if (RayCastControl(ref mousePos, out var hitControl) &&
|
|
||||||
(transformGizmo == null || !transformGizmo.Selection.Any(x => x.EditableObject is UIControl controlActor && controlActor.Control == hitControl)))
|
|
||||||
{
|
|
||||||
DrawControl(null, hitControl, false, ref mousePos, ref drawAnySelectedControl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (drawAnySelectedControl)
|
if (drawAnySelectedControl)
|
||||||
Render2D.PopTransform();
|
Render2D.PopTransform();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user