GUI Size via Scale results in Incorrect Size

Hey everyone, A ghetto fix (lol) I found that works is detecting when a gui instance becomes visible and changing the clipsdescendants property back and forth - this trick works with other properties as well but I chose clipdescendants:

local function FixSizingBug(GuiInstance)
	if (GuiInstance:IsA("GuiObject")) then
		local function OnVisibilityChanged()
			local IsClipsDescendantsEnabled = GuiInstance.ClipsDescendants
				
			GuiInstance.ClipsDescendants = not IsClipsDescendantsEnabled
			GuiInstance.ClipsDescendants = IsClipsDescendantsEnabled
		end
		
		GuiInstance:GetPropertyChangedSignal("Visible"):Connect(OnVisibilityChanged)
		OnVisibilityChanged()
	end
end

for _, Child in ipairs(MainGui:GetChildren()) do
	FixSizingBug(Child)
end

MainGui.ChildAdded:Connect(FixSizingBug)
--MainGui is a screen gui containing all of the gui instances
4 Likes