Skip to content

Commit 4897ced

Browse files
committed
minor improvements and bug fixes
1 parent e7a6b86 commit 4897ced

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

KeyUI.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,8 @@ function addon:SetKey(button)
785785
end
786786

787787
-- Calculate the maximum allowed characters based on button width
788-
local max_allowed_chars = math.floor(button:GetWidth() / 8)
789-
local combined_text = button.short_key:GetText() -- Combined text with modifiers if present
788+
local max_allowed_chars = math.floor(button:GetWidth() / 9)
789+
local combined_text = button.short_key:GetText() or "" -- Use empty string if GetText() returns nil
790790

791791
-- Use Condensed font if the combined text exceeds max_allowed_chars
792792
if string.len(combined_text) > max_allowed_chars then

0 commit comments

Comments
 (0)