Permalink
Browse files

Fixed a stack overflow with DListView

  • Loading branch information...
1 parent e488a65 commit 2450ffcf8b7d54e6c8d4a137765a23a58321b2ae @robotboy655 robotboy655 committed Jul 14, 2016
Showing with 3 additions and 3 deletions.
  1. +2 −2 garrysmod/lua/vgui/dlistview.lua
  2. +1 −1 garrysmod/lua/vgui/dlistview_column.lua
@@ -129,7 +129,7 @@ function PANEL:FixColumnsLayout()
local ChangeRequired = self.pnlCanvas:GetWide() - AllWidth
local ChangePerColumn = math.floor( ChangeRequired / NumColumns )
- local Remainder = ChangeRequired - (ChangePerColumn * NumColumns)
+ local Remainder = ChangeRequired - ( ChangePerColumn * NumColumns )
for k, Column in pairs( self.Columns ) do
@@ -148,7 +148,7 @@ function PANEL:FixColumnsLayout()
Remainder = math.Approach( Remainder, 0, PerPanel )
local TargetWidth = Column:GetWide() + PerPanel
- Remainder = Remainder + (TargetWidth - Column:SetWidth( TargetWidth ))
+ Remainder = Remainder + ( TargetWidth - Column:SetWidth( TargetWidth ) )
if ( Remainder == 0 ) then break end
@@ -135,7 +135,7 @@ function PANEL:SetWidth( iSize )
iSize = math.Clamp( iSize, self.m_iMinWidth, self.m_iMaxWidth )
-- If the column changes size we need to lay the data out too
- if ( iSize != self:GetWide() ) then
+ if ( math.floor( iSize ) != self:GetWide() ) then
self:GetParent():SetDirty( true )
end

0 comments on commit 2450ffc

Please sign in to comment.