Fix subtitle with small dimensions not getting created #893

This commit is contained in:
xen-42 2024-10-03 00:02:20 -04:00
parent 51ea50ac68
commit bd1abecb87
2 changed files with 2 additions and 1 deletions

View File

@ -41,6 +41,7 @@ namespace NewHorizons.External.Configs
/// <summary> /// <summary>
/// The path to the addons subtitle for the main menu. /// The path to the addons subtitle for the main menu.
/// Defaults to "subtitle.png". /// Defaults to "subtitle.png".
/// The dimensions of the Echos of the Eye subtitle is 669 x 67, so aim for that size
/// </summary> /// </summary>
public string subtitlePath = "subtitle.png"; public string subtitlePath = "subtitle.png";
} }

View File

@ -109,7 +109,7 @@ namespace NewHorizons.Handlers
var tex = ImageUtilities.GetTexture(mod, filepath, false); var tex = ImageUtilities.GetTexture(mod, filepath, false);
if (tex == null) return; if (tex == null) return;
var sprite = Sprite.Create(tex, new Rect(0.0f, 0.0f, tex.width, Mathf.Max(SUBTITLE_HEIGHT, tex.height)), new Vector2(0.5f, 0.5f), 100.0f); var sprite = Sprite.Create(tex, new Rect(0.0f, 0.0f, tex.width, tex.height), new Vector2(0.5f, 0.5f), 100.0f);
AddSubtitle(sprite); AddSubtitle(sprite);
} }