(cb10b53db) Fixed GUIImage.RecalculateScale throwing an exception if the sprite is not set, use relative scales in GUINumberInput to make the child elements scale dynamically with the parent
This commit is contained in:
@@ -125,7 +125,7 @@ namespace Barotrauma
|
||||
|
||||
private void RecalculateScale()
|
||||
{
|
||||
Scale = sprite.SourceRect.Width == 0 || sprite.SourceRect.Height == 0 ?
|
||||
Scale = sprite == null || sprite.SourceRect.Width == 0 || sprite.SourceRect.Height == 0 ?
|
||||
1.0f :
|
||||
Math.Min(RectTransform.Rect.Width / (float)sprite.SourceRect.Width, RectTransform.Rect.Height / (float)sprite.SourceRect.Height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user