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

Screen.safeArea missing when using Unity 2017.2.0f3. Fixes #126. #127

Merged
merged 1 commit into from
May 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ private void OnZoomOut()
private void OnHome()
{
// scroll to the center of the screen.
#if UNITY_2017_2_OR_NEWER
#if UNITY_2017_2_OR_NEWER && !UNITY_2017_2
viewportScroll = new Vector2(Screen.safeArea.width / 2.0f / EditorGUIUtility.pixelsPerPoint, Screen.safeArea.height / 2.0f / EditorGUIUtility.pixelsPerPoint);
#else
viewportScroll = new Vector2(Screen.width / 2.0f, Screen.height / 2.0f);
Expand Down Expand Up @@ -1452,7 +1452,7 @@ private void OnToolsPivotResetPosition()

private Rect GetViewportRect()
{
#if UNITY_2017_2_OR_NEWER
#if UNITY_2017_2_OR_NEWER && !UNITY_2017_2
Rect viewportRect = Screen.safeArea;
#else
Rect viewportRect = new Rect(0, 0, Screen.width, Screen.height);
Expand Down Expand Up @@ -1584,7 +1584,7 @@ private void ShowCenteredPopupWindowContent(PopupWindowContent popup)
Vector2 size = popup.GetWindowSize();
try
{
#if UNITY_2017_2_OR_NEWER
#if UNITY_2017_2_OR_NEWER && !UNITY_2017_2
PopupWindow.Show(new Rect((Screen.safeArea.width / 2.0f / EditorGUIUtility.pixelsPerPoint) - (size.x / 2.0f), (Screen.safeArea.height / 2.0f / EditorGUIUtility.pixelsPerPoint) - (size.y / 2.0f), 0, 0), popup);
#else
PopupWindow.Show(new Rect((Screen.width / 2.0f) - (size.x / 2.0f), (Screen.height / 2.0f) - (size.y / 2.0f), 0, 0), popup);
Expand Down