I’m experiencing some odd behavior when using GUILayout.FlexibleSpace and GUILayout.Space
The code bellow will draw box with a centered vertical slider and a button on the bottom.
The odd thing is that GUILayout.FlexibleSpace is also adding an horizontal space on the button.
Is this a bug?
function OnGUI()
{
GUI.Box(finalRect,"");
GUILayout.BeginArea(finalRect);
GUILayout.BeginVertical();
GUILayout.BeginHorizontal();
//GUILayout.Space(5);
GUILayout.FlexibleSpace();
GUILayout.BeginVertical();
//GUILayout.Label("Control de Camara");
GUILayout.Label(GUIContent(zoomInIcon));
distanceValue = GUILayout.VerticalSlider(distanceValue, minDistance, maxDistance);
GUILayout.Label(GUIContent(zoomOutIcon));
GUILayout.EndVertical();
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
//GUILayout.Space(25);
if(GUILayout.Button("Vista\nFrontal"))
{
}
GUILayout.EndVertical();
GUILayout.EndArea();
}
The images show how the menu looks using GUILayout.FlexibleSpace and not using any space.

