using System;
using UnityEngine;

namespace Leap.Unity
{
	public class FitHeightToScreen : MonoBehaviour
	{
		private void Awake()
		{
			float num = (float)(base.GetComponent<GUITexture>().texture.width / base.GetComponent<GUITexture>().texture.height);
			float num2 = num * (float)Screen.height;
			float x = ((float)Screen.width - num2) / 2f;
			base.GetComponent<GUITexture>().pixelInset = new Rect(x, 0f, num2, (float)Screen.height);
		}
	}
}
