--[[
	
	Calculates a ratio for interface scaling based on resolution (screen size). Used for scaling down, not up.
	
	Functions.ResolutionScale()
	
--]]



return function()
	--- Return cache
	if tick() - lastCalcTick <= 0.05 then
		return lastCalc
	end
	
	--- calc
	local resolution = camera.ViewportSize
	local resolutionScale = resolution.Magnitude
	local scale = math.clamp(resolutionScale / 1800, 0.33, 1)
	
	--- Cache
	lastCalc = scale
	lastCalcTick = tick()
	
	--
	return scale
end
