Skip to content

Commit

Permalink
invalidate parent if size changed
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll committed Feb 6, 2025
1 parent 6986a37 commit af0d7c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gamemodes/terrortown/gamemode/client/cl_vskin/vgui/dlabel_ttt2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,18 @@ function PANEL:OnRebuildLayout(w, h)
self:ApplyVSkinDimension("posIconX", posIconX)
self:ApplyVSkinDimension("posIconY", posIconY)
end

-- if the panel changed size and the panel has a parent, the parent should
-- be recalculcating its size as well
if self:GetFitToContentX() or self:GetFitToContentY() then
local parent = self:GetParent()

if not IsValid(parent) then
return
end

parent:InvalidateLayout(true)
end
end

---
Expand Down

0 comments on commit af0d7c5

Please sign in to comment.