Scaled GUI

I have a GUI Texture, when I click on it a GUI Button should appear. It all worked well until I put the “scaled code”. I found the scaling part on some other question.

How can I make it work?
Here’s my code.

private bool displayMusic = false;
public GUITexture myTexture;
private Vector3 scale;
int originalWidth = 640;
int originalHeight = 400;

void OnGUI() 
{
	scale.x = Screen.width/originalWidth; // calculate hor scale
	scale.y = Screen.height/originalHeight; // calculate vert scale
	scale.z = 1;
	Matrix4x4 svMat = GUI.matrix;
	GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, scale);

	if (Input.GetMouseButton (0) && myTexture.HitTest (Input.mousePosition)) 
	{
		displayMusic=true;					
	}

	if (displayMusic) 
	{ 
		if (AudioListener.volume != 0 && GUI.Button (new Rect(1005,130,135,30), "Sound effects: ON"))
		{
			AudioListener.volume = 0;
			displayMusic=false;
		}
		else 

		if (AudioListener.volume == 0  && GUI.Button (new Rect(1005,130,135,30), "Sound effects: OFF"))
		{
			AudioListener.volume = 100;
			displayMusic=false;
		}

	}
	GUI.matrix = svMat; 

}

}

Matrix4x4.TRS() changes the way that rendering happens. It does not change the way that input touch and mouse position get computed. Don’t use this approach to resize your GUI elements.