下記コードで RenderTexture を表示させた場合は
下図のように横幅が広がってしまう
// public static Rect GetRect(float minWidth, float maxWidth, float minHeight, float maxHeight); var rect = GUILayoutUtility.GetRect( 0, _renderTexture.width, 0, _renderTexture.height ); EditorGUI.DrawTextureTransparent(rect, _renderTexture);
次に GUILayoutOption を 利用してみる
そうすると正しく、表示されます
// public static Rect GetRect(float width, float height, params GUILayoutOption[] options) var rect = GUILayoutUtility.GetRect( 0, 0, GUILayout.MaxWidth(_renderTexture.width), GUILayout.MaxHeight(_renderTexture.height) );