aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAc_K <Acoustik666@gmail.com>2021-07-06 20:55:03 +0200
committerGitHub <noreply@github.com>2021-07-06 20:55:03 +0200
commita6c2b5d6ec6d205a421e23b767ed9157c8296656 (patch)
treec437f1e56dae7ace3fa4c33faa4c3114432976b2
parent242e51c7f5da7f1bb044400332383c89ff379121 (diff)
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 .
-rw-r--r--Ryujinx/Ui/Windows/ControllerWindow.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Ryujinx/Ui/Windows/ControllerWindow.cs b/Ryujinx/Ui/Windows/ControllerWindow.cs
index 655f1afb..c57a62c7 100644
--- a/Ryujinx/Ui/Windows/ControllerWindow.cs
+++ b/Ryujinx/Ui/Windows/ControllerWindow.cs
@@ -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;