Skip to content

Commit

Permalink
fix for scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaredd committed Nov 21, 2020
1 parent b0ee030 commit 068d047
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Editor/Scripts/MarkdownViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,27 @@ protected Rect GetEditorRect()
{
#if !UNITY_2018

// fix for Screen.height
var offset = 450.0f;
var scale = 2.0f;

// calculate working space
if( Event.current.type == EventType.Layout )
{
var offset = 32.0f + 96.0f + 4.0f; // tab height + asset labels height + offset
mHeight = ( Screen.height - offset ) / 1.5115f;
mHeight = ( Screen.height - offset ) / scale;
}

// reserve space (we are going to paint on it directly)
GUILayout.Space( mHeight );

// return working rect
return new Rect( 0.0f, 4.0f, EditorGUIUtility.currentViewWidth, mHeight );
return new Rect( 0.0f, 10.0f, EditorGUIUtility.currentViewWidth, mHeight );
#else
GUILayout.FlexibleSpace();
var rectContainer = GUILayoutUtility.GetLastRect();
rectContainer.width = EditorGUIUtility.currentViewWidth;
return rectContainer;

#endif
}

Expand Down

0 comments on commit 068d047

Please sign in to comment.