Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee3c6e8

Browse filesBrowse files
Optimize DLabel autostretch behavior (Facepunch#2089)
1 parent 1575985 commit ee3c6e8
Copy full SHA for ee3c6e8

File tree

Expand file treeCollapse file tree

1 file changed

+11
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-6
lines changed

‎garrysmod/lua/vgui/dlabel.lua

Copy file name to clipboardExpand all lines: garrysmod/lua/vgui/dlabel.lua
+11-6Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,22 @@ function PANEL:ApplySchemeSettings()
136136

137137
end
138138

139-
function PANEL:Think()
139+
function PANEL:PerformLayout()
140+
141+
self:ApplySchemeSettings()
140142

141143
if ( self:GetAutoStretchVertical() ) then
142-
self:SizeToContentsY()
143-
end
144144

145-
end
145+
local dockType = self:GetDock()
146146

147-
function PANEL:PerformLayout()
147+
-- Auto stretch will layout infinitely with these dock types, so we'll ignore them
148+
if ( dockType != FILL && dockType != LEFT && dockType != RIGHT ) then
148149

149-
self:ApplySchemeSettings()
150+
self:SizeToContentsY()
151+
152+
end
153+
154+
end
150155

151156
end
152157

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.