--- Recalculate the window height

function Window:UpdateWindowHeight()
	local windowHeight = LINE_HEIGHT

	for _, child in pairs(Gui:GetChildren()) do
		if child:IsA("GuiObject") then
			windowHeight = windowHeight + child.Size.Y.Offset
		end
	end

	Gui.CanvasSize = UDim2.new(Gui.CanvasSize.X.Scale, Gui.CanvasSize.X.Offset, 0, windowHeight)
	Gui.Size =
		UDim2.new(
		Gui.Size.X.Scale,
		Gui.Size.X.Offset,
		0,
		windowHeight > WINDOW_MAX_HEIGHT and WINDOW_MAX_HEIGHT or windowHeight
	)

	Gui.CanvasPosition = Vector2.new(0, math.clamp(windowHeight - 300, 0, math.huge))
end
