Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #191. Bugs with long screen devices in some menu #261

Merged
Show file tree
Hide file tree
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
82 changes: 41 additions & 41 deletions Unity/Assets/UMAssets/Scripts/XeApp/Core/FlexibleLayoutCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,57 +102,57 @@ private void FlexibleAspectProcess()
flexibleViewportCameraList[i].rect = new Rect(0, 0, 1, 1);
}
}
}
else
{
float w, h, sw, sh, r, sr;
if(SystemManager.isLongScreenDevice)
else
{
if(SystemManager.Instance.CheckOverPermissionAspectRatio() == SystemManager.OverPermissionAspectResult.HdivV)
float w, h, sw, sh, r, sr;
if(!SystemManager.isLongScreenDevice)
{
if(SystemManager.Instance.CheckOverPermissionAspectRatio() == SystemManager.OverPermissionAspectResult.HdivV)
{
w = baseWidth;
h = baseHeight;
sw = Screen.width;
sh = Screen.height;
r = w / h;
}
else
{
w = baseWidth;
h = baseHeight;
sw = Screen.height;
sh = Screen.width;
r = w / h;
}
sr = sw / sh;
}
else
{
w = baseWidth;
h = baseHeight;
w = 1;
h = 1;
sw = Screen.width;
sh = Screen.height;
r = w / h;
r = 1.777778f;
sr = sw / sh;
}
else
float safeRatio = 1;
if(SystemManager.rawSafeAreaRect.height >= 0)
{
w = baseWidth;
h = baseHeight;
sw = Screen.height;
sh = Screen.width;
r = w / h;
safeRatio = SystemManager.rawSafeAreaRect.height / SystemManager.rawScreenAreaRect.height;
}
sr = sw / sh;
}
else
{
w = 1;
h = 1;
sw = Screen.width;
sh = Screen.height;
r = 1.777778f;
sr = sw / sh;
}
float safeRatio = 1;
if(SystemManager.rawSafeAreaRect.height >= 0)
{
safeRatio = SystemManager.rawSafeAreaRect.height / SystemManager.rawScreenAreaRect.height;
}
r = r / sr;
float f = (1 - r) * 0.5f;
for (int i = 0; i < flexibleViewportCameraList.Count; i++)
{
if (SystemManager.isLongScreenDevice)
r = r / sr;
float f = (1 - r) * 0.5f;
for (int i = 0; i < flexibleViewportCameraList.Count; i++)
{
if (SystemManager.Instance.CheckOverPermissionAspectRatio() == SystemManager.OverPermissionAspectResult.VdivH)
flexibleViewportCameraList[i].rect = new Rect(0, f, 1, r);
if (!SystemManager.isLongScreenDevice)
{
if (SystemManager.Instance.CheckOverPermissionAspectRatio() == SystemManager.OverPermissionAspectResult.VdivH)
flexibleViewportCameraList[i].rect = new Rect(0, f, 1, r);
else
flexibleViewportCameraList[i].rect = new Rect(f, 0, r, 1);
}
else
flexibleViewportCameraList[i].rect = new Rect(f, 0, r, 1);
flexibleViewportCameraList[i].rect = new Rect(f, 1 - safeRatio, r, safeRatio);
}
else
flexibleViewportCameraList[i].rect = new Rect(f, 1 - safeRatio, r, safeRatio);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private IEnumerator Co_loadAssets()
{
ViewModeCameraMan camMan = m_cameraObj.AddComponent<ViewModeCameraMan>();
yield return Co.R(camMan.Co_loadAssets());
if(!SystemManager.isLongScreenDevice)
if(SystemManager.isLongScreenDevice)
{
FlexibleCameraChanger f = FlexibleCameraChanger.AddComponent(m_cameraObj, true, false, 0, 0);
f.Initialize();
Expand Down