Smartmobili.Cocoa.NSView._computeScale C# (CSharp) Method

_computeScale() static private method

static private _computeScale ( NSSize fs, NSSize bs ) : NSSize
fs NSSize
bs NSSize
return NSSize
        static NSSize _computeScale(NSSize fs, NSSize bs)
        {
            NSSize scale = NS.MakeSize (0, 0);

            if (bs.Width == 0)
            {
                if (fs.Width == 0)
                    scale.Width = 1;
                else
                    scale.Width = Int64.MaxValue;
            }
            else
            {
                scale.Width = fs.Width / bs.Width;
            }
            if (bs.Height == 0)
            {
                if (fs.Height == 0)
                    scale.Height = 1;
                else
                    scale.Height = Int64.MaxValue;
            }
            else
            {
                scale.Height = fs.Height / bs.Height;
            }

            return scale;
        }
NSView