Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #243 from Henry00IS/20193
Browse files Browse the repository at this point in the history
Unity 2019.3 fixed vertex, face and paint tool window size.
  • Loading branch information
Henry00IS committed Dec 23, 2019
2 parents 6b4dffd + dafcd6c commit 71efd3f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Scripts/Tools/PaintEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -474,14 +474,22 @@ public override void OnSceneGUI(SceneView sceneView, Event e)
switch (drawingMode)
{
case DrawingMode.Color:
#if UNITY_2019_3_OR_NEWER
toolbarHeight = 230;
#else
toolbarHeight = 217;
#endif
break;

case DrawingMode.R:
case DrawingMode.G:
case DrawingMode.B:
case DrawingMode.Alpha:
#if UNITY_2019_3_OR_NEWER
toolbarHeight = 138;
#else
toolbarHeight = 126;
#endif
break;
}

Expand Down
4 changes: 4 additions & 0 deletions Scripts/Tools/SurfaceEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ private enum AlignDirection
private float unroundedDeltaAngle = 0;

// Main UI rectangle for this tool's UI
#if UNITY_2019_3_OR_NEWER
private readonly Rect toolbarRect = new Rect(6, 40, 215, 245);
#else
private readonly Rect toolbarRect = new Rect(6, 40, 200, 226);
#endif

// Used to track what polygons have been previously clicked on, so that the user can cycle click through objects
// on the same (or similar) ray cast
Expand Down
10 changes: 7 additions & 3 deletions Scripts/Tools/VertexEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -997,9 +997,13 @@ public void OnRepaint (SceneView sceneView, Event e)
DrawVertices(sceneView, e);
}

// Draw UI specific to this editor
Rect rectangle = new Rect(0, 50, 175, 180);
GUIStyle toolbar = new GUIStyle(EditorStyles.toolbar);
// Draw UI specific to this editor
#if UNITY_2019_3_OR_NEWER
Rect rectangle = new Rect(0, 50, 185, 195);
#else
Rect rectangle = new Rect(0, 50, 175, 180);
#endif
GUIStyle toolbar = new GUIStyle(EditorStyles.toolbar);
toolbar.normal.background = SabreCSGResources.ClearTexture;
toolbar.fixedHeight = rectangle.height;
GUILayout.Window(140002, rectangle, OnToolbarGUI, "", toolbar);
Expand Down

0 comments on commit 71efd3f

Please sign in to comment.