@@ -75,38 +75,39 @@ Layout ParseDocument()
7575
7676 //------------------------------------------------------------------------------
7777
78- public void Draw ( )
78+ private void ClearBackground ( float height )
7979 {
80- GUI . skin = mSkin ;
81- GUI . enabled = true ;
80+ var rectFullScreen = new Rect ( 0.0f , 0.0f , Screen . width , Mathf . Max ( height , Screen . height ) ) ;
81+ GUI . DrawTexture ( rectFullScreen , mSkin . window . normal . background , ScaleMode . StretchToFill , false ) ;
82+ }
8283
83- // clear background
8484
85- var rectFullScreen = new Rect ( 0.0f , 0.0f , Screen . width , Screen . height ) ;
86- GUI . DrawTexture ( rectFullScreen , GUI . skin . window . normal . background , ScaleMode . StretchToFill , false ) ;
85+ //------------------------------------------------------------------------------
8786
87+ public void Draw ( )
88+ {
89+ GUI . skin = mSkin ;
90+ GUI . enabled = true ;
8891
89- // content rect
92+ // useable width of inspector windows
9093
91- var contentWidth = EditorGUIUtility . currentViewWidth - GUI . skin . verticalScrollbar . fixedWidth - 2.0f * Margin . x ;
94+ var contentWidth = EditorGUIUtility . currentViewWidth - mSkin . verticalScrollbar . fixedWidth - 2.0f * Margin . x ;
9295
9396
9497 // draw content
9598
9699 if ( mRaw )
97100 {
98- EditorGUILayout . SelectableLabel ( mText , GUI . skin . GetStyle ( "raw" ) ) ;
101+ var style = mSkin . GetStyle ( "raw" ) ;
102+ var width = contentWidth - mSkin . button . fixedHeight ;
103+ var height = style . CalcHeight ( new GUIContent ( mText ) , width ) ;
104+
105+ ClearBackground ( height ) ;
106+ EditorGUILayout . SelectableLabel ( mText , style , new GUILayoutOption [ ] { GUILayout . Width ( width ) , GUILayout . Height ( height ) } ) ;
99107 }
100108 else
101109 {
102- // reserve the space
103-
104- #if ! UNITY_2018
105- GUILayout . Space ( mLayout . Height ) ;
106- #else
107- GUILayout . FlexibleSpace ( ) ;
108- #endif
109-
110+ ClearBackground ( mLayout . Height ) ;
110111 DrawMarkdown ( contentWidth ) ;
111112 }
112113
@@ -167,6 +168,7 @@ void DrawMarkdown( float width )
167168 break ;
168169
169170 case EventType . Layout :
171+ GUILayout . Space ( mLayout . Height ) ;
170172 mLayout . Arrange ( width ) ;
171173 break ;
172174
0 commit comments