Fix for Crash Caused by the Entity Spawn Menu (#1588)

This commit is contained in:
Fortune117
2021-02-21 20:16:01 +01:00
committed by GitHub
parent 17fe000a1e
commit 9954d571de
@@ -239,7 +239,7 @@ namespace Robust.Client.UserInterface.CustomControls
// Calculate index of first prototype to render based on current scroll.
var height = MeasureButton.DesiredSize.Y + PrototypeListContainer.Separation;
var offset = -PrototypeList.Position.Y;
var offset = Math.Max(-PrototypeList.Position.Y, 0);
var startIndex = (int) Math.Floor(offset / height);
PrototypeList.ItemOffset = startIndex;