mirror of
https://github.com/Earu/EasyChat.git
synced 2025-03-04 03:13:20 -05:00
Fix a markup bug serverside
This commit is contained in:
parent
15ec924361
commit
177311e118
@ -614,10 +614,20 @@ function text_part:Draw(ctx)
|
||||
ctx:CallPostTextDrawFunctions(x, y, self.Size.W, self.Size.H)
|
||||
end
|
||||
|
||||
function text_part:IsTextWider(text, width)
|
||||
surface_SetFont(self.Font)
|
||||
local w, _ = surface_GetTextSize(text)
|
||||
return w >= width
|
||||
if CLIENT then
|
||||
function text_part:IsTextWider(text, width)
|
||||
surface_SetFont(self.Font)
|
||||
local w, _ = surface_GetTextSize(text)
|
||||
return w >= width
|
||||
end
|
||||
end
|
||||
|
||||
-- assume we're using the default font on server
|
||||
if SERVER then
|
||||
function text_part:IsTextWider(text, width)
|
||||
local w, _ = #text * 16
|
||||
return w >= width
|
||||
end
|
||||
end
|
||||
|
||||
local hard_break_treshold = 10
|
||||
|
Loading…
Reference in New Issue
Block a user