From 1a50a5f72f61e6cb714ed50ebccd33a01b4b6ecc Mon Sep 17 00:00:00 2001 From: Rubat <3299036+robotboy655@users.noreply.github.com> Date: Thu, 9 Dec 2021 17:26:35 +0200 Subject: [PATCH] Fixed MarkupObject:Draw's new argument not working without MaxWidth being set --- garrysmod/lua/includes/modules/markup.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/garrysmod/lua/includes/modules/markup.lua b/garrysmod/lua/includes/modules/markup.lua index ba190ea5c4..d3ba5729f9 100644 --- a/garrysmod/lua/includes/modules/markup.lua +++ b/garrysmod/lua/includes/modules/markup.lua @@ -247,13 +247,13 @@ function MarkupObject:Draw( xOffset, yOffset, halign, valign, alphaoverride, tex surface.SetTextColor( blk.colour.r, blk.colour.g, blk.colour.b, alpha ) surface.SetTextPos( x, y ) - if ( textAlign ~= TEXT_ALIGN_LEFT and self.maxWidth ) then + if ( textAlign ~= TEXT_ALIGN_LEFT ) then local lineWidth = self.lineWidths[ blk.offset.y ] if ( lineWidth ) then if ( textAlign == TEXT_ALIGN_CENTER ) then - surface.SetTextPos( x + ( ( self.maxWidth - lineWidth ) / 2 ), y ) + surface.SetTextPos( x + ( ( self:GetMaxWidth() - lineWidth ) / 2 ), y ) elseif ( textAlign == TEXT_ALIGN_RIGHT ) then - surface.SetTextPos( x + ( self.maxWidth - lineWidth ), y ) + surface.SetTextPos( x + ( self:GetMaxWidth() - lineWidth ), y ) end end end