1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-10-01 12:30:00 +02:00

ui: Fixes GetShrinkedGamepadName (#2444)

There is a wrong condition in `GetShrinkedGamepadName` which throw an oob if the controller name is equal to the checked value. It's now fixed and shoud closes #2442 .
This commit is contained in:
Ac_K 2021-07-06 20:55:03 +02:00 committed by GitHub
parent 242e51c7f5
commit a6c2b5d6ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,12 +231,12 @@ namespace Ryujinx.Ui.Windows
private static string GetShrinkedGamepadName(string str)
{
const string ShrinkChars = "..";
const int MaxSize = 52;
const string ShrinkChars = "...";
const int MaxSize = 50;
if (str.Length > MaxSize - ShrinkChars.Length)
if (str.Length > MaxSize)
{
return str.Substring(0, MaxSize) + ShrinkChars;
return str.Substring(0, MaxSize - ShrinkChars.Length) + ShrinkChars;
}
return str;