idTech4.UI.idWindow.ScreenToClient C# (CSharp) Method

ScreenToClient() public method

public ScreenToClient ( idRectangle &rect ) : void
rect idRectangle
return void
		public void ScreenToClient(ref idRectangle rect)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			int x, y;
			idWindow p;

			for(p = this, x = 0, y = 0; p != null; p = p.Parent)
			{
				x += (int) p.Rectangle.X;
				y += (int) p.Rectangle.Y;
			}

			rect.X -= x;
			rect.Y -= y;
		}