Merge branch 'fix-multiblend-exception' of https://github.com/Tryibion/FlaxEngine into Tryibion-fix-multiblend-exception

This commit is contained in:
Wojtek Figat
2025-01-12 21:56:28 +01:00

View File

@@ -1205,13 +1205,16 @@ namespace FlaxEditor.Surface.Archetypes
// Highlight selected blend point // Highlight selected blend point
var style = Style.Current; var style = Style.Current;
var selectedIndex = _selectedAnimation.SelectedIndex; var selectedIndex = _selectedAnimation.SelectedIndex;
if (selectedIndex != -1 && (ContainsFocus || IsMouseOver)) if (selectedIndex != -1 && selectedIndex < _editor.BlendPoints.Count && (ContainsFocus || IsMouseOver))
{ {
var point = _editor.BlendPoints[selectedIndex]; var point = _editor.BlendPoints[selectedIndex];
var highlightColor = point.IsMouseDown ? style.SelectionBorder : style.BackgroundSelected; if (point != null)
Render2D.PushTint(ref highlightColor); {
Render2D.DrawTriangles(_selectedTriangles, _selectedColors); var highlightColor = point.IsMouseDown ? style.SelectionBorder : style.BackgroundSelected;
Render2D.PopTint(); Render2D.PushTint(ref highlightColor);
Render2D.DrawTriangles(_selectedTriangles, _selectedColors);
Render2D.PopTint();
}
} }
} }