Pinta.ImageManipulation.ScaleFactor.GetNextLarger C# (CSharp) Method

GetNextLarger() public method

Rounds the current scaling factor up to the next power of two.
public GetNextLarger ( ) : ScaleFactor
return ScaleFactor
		public ScaleFactor GetNextLarger ()
		{
			double ratio = Ratio + 0.005;

			int index = Array.FindIndex (
			    scales,
			    delegate (double scale) {
				    return ratio <= scale;
			    });

			if (index == -1) {
				index = scales.Length;
			}

			index = Math.Min (index, scales.Length - 1);

			return ScaleFactor.FromDouble (scales[index]);
		}