How to properly control width of button/panel in EditorGUILayout to fit in the inspector?

Hi, I’ve create custom editor layout in the inspector. My problem is that GUI layout in the inspector got messed up when there are too many line spacing.

You can see in the first image that if all contents can be shown in the inspector, the GUI layout looks fine. But if it’s not then some buttons or panels got stretched like in the second image. What’s the problem? And how can I fix it?

Solve it by adding option GUILayout.MaxWidth(Screen.width - offset)