protected virtual void OnCanvasGUI() { GUI.BeginClip(clipRect); GlobalMousePosition = Event.current.mousePosition; Rect r = new Rect(Vector2.zero, clipRect.size); RootCanvas.LocalRect = r; ScaledCanvas.LocalRect = r; RootCanvas.CalculateGlobalRect(true); OnResized(); RootCanvas.OnGUI(r); GUI.EndClip(); }