diff --git a/Editor/Scripts/MarkdownViewer.cs b/Editor/Scripts/MarkdownViewer.cs index 97da926..c42277a 100644 --- a/Editor/Scripts/MarkdownViewer.cs +++ b/Editor/Scripts/MarkdownViewer.cs @@ -83,8 +83,7 @@ protected Rect GetEditorRect() #else GUILayout.FlexibleSpace(); var rectContainer = GUILayoutUtility.GetLastRect(); - rectContainer.width = Screen.width; - + rectContainer.width = EditorGUIUtility.currentViewWidth; return rectContainer; #endif } @@ -106,15 +105,13 @@ public void Draw() var rectFullScreen = new Rect( 0.0f, rectContainer.yMin - 4.0f, Screen.width, Screen.height ); GUI.DrawTexture( rectFullScreen, EditorGUIUtility.whiteTexture, ScaleMode.StretchToFill, false ); - Debug.Log( rectContainer.width ); - // scroll window var padLeft = 8.0f; var padRight = 4.0f; var padHoriz = padLeft + padRight; var scrollWidth = GUI.skin.verticalScrollbar.fixedWidth; - var minWidth = rectContainer.width - scrollWidth - padHoriz - 200.0f; + var minWidth = rectContainer.width - scrollWidth - padHoriz; var maxHeight = ContentHeight( minWidth ); var hasScrollbar = maxHeight >= rectContainer.height; diff --git a/Editor/Skin/MarkdownViewerSkin.guiskin b/Editor/Skin/MarkdownViewerSkin.guiskin index 37ea1e6..8235adc 100644 --- a/Editor/Skin/MarkdownViewerSkin.guiskin +++ b/Editor/Skin/MarkdownViewerSkin.guiskin @@ -1148,7 +1148,7 @@ MonoBehaviour: m_TextClipping: 1 m_ImagePosition: 2 m_ContentOffset: {x: 0, y: 0} - m_FixedWidth: 15 + m_FixedWidth: 20 m_FixedHeight: 0 m_StretchWidth: 0 m_StretchHeight: 1