currentViewWidth gives the total width of the inspector view, but what about when I’m using the same for a property embedded within a foldout? How do I detect if my property drawer has to draw inside a foldout, and how do i get the permitted width or the foldout left margin?
In Editors, you can use this function the get the rect (width/height) of the next control the EditorGUILayout will draw. Not sure if this is what you need, but might be.
In property drawer’s you need to keep track of this yourself. Starting with the Rect parameter passed into the property drawer’s GUI function, manually compute the rects you want to draw each of your controls in. (Property drawers CANNOT use the automatic layout provided by the EditorGUILayout functions)