Skip to content

Commit

Permalink
Fixed screen size in build
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed May 28, 2018
1 parent d9d5071 commit bd8ceba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Assets/Scenes/Main.unity
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Prefab:
- target: {fileID: 224261597021104126, guid: 79c2718dd59243e4c90e145349e7dadf,
type: 2}
propertyPath: m_AnchoredPosition.y
value: 0.000030517578
value: 0.000061035156
objectReference: {fileID: 0}
- target: {fileID: 4679437618935694, guid: 79c2718dd59243e4c90e145349e7dadf, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
Expand Down
12 changes: 6 additions & 6 deletions Assets/Scripts/FakePointManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ public void Clear()

public void ChangeResolution()
{
var newWidth = Mathf.Clamp(Width, WidthMin, Screen.width);
var newHeight = Mathf.Clamp(Height, HeightMin, Screen.height);
var ratio = Width / Height;
var newWidth = Mathf.Clamp(Width, WidthMin * ratio, Screen.width);
var newHeight = Mathf.Clamp(Height, HeightMin, Screen.height);

if (Height > Width)
Screen.SetResolution(newWidth, newHeight * ratio, false);
else
Screen.SetResolution(newWidth * ratio, newHeight, false);
Screen.SetResolution(newWidth, newHeight, false);
//if (Height < Width)
//else
// Screen.SetResolution(newWidth * ratio, newHeight, false);
}

public void OnMouseDrag()
Expand Down

0 comments on commit bd8ceba

Please sign in to comment.