Skip to content

Commit 486f106

Browse files
committed
Canel moving blackspace with calculation.
1 parent ae4d864 commit 486f106

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed

Assets/JCSUnity/Scripts/GUI/JCS_PanelRoot.cs

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -94,42 +94,8 @@ private void FitPerfectSize()
9494
{
9595
JCS_ScreenSettings ss = JCS_ScreenSettings.instance;
9696

97-
// get app rect
98-
RectTransform appRect = JCS_Canvas.instance.GetAppRect();
99-
100-
float newWidth = appRect.sizeDelta.x;
101-
float newHeight = appRect.sizeDelta.y;
102-
103-
/* Adjust the panel width and height base on the
104-
* blackspaces width and height.
105-
*/
106-
{
107-
float blackspace_width = ss.BlackspaceWidth();
108-
float blackspace_height = ss.BlackspaceHeight();
109-
110-
bool blackspace_w_valid = (JCS_Mathf.isPositive(blackspace_width) || blackspace_width == 0.0f);
111-
bool blackspace_h_valid = (JCS_Mathf.isPositive(blackspace_height) || blackspace_height == 0.0f);
112-
113-
if (ss.STARTING_SCREEN_WIDTH != 0)
114-
{
115-
// There is blackspaces on the horizontal axis. (left and right)
116-
if (blackspace_w_valid)
117-
newWidth -= blackspace_width;
118-
// Otherwise should be on the vertical axis. (top and bottom)
119-
else
120-
newWidth += blackspace_height;
121-
}
122-
123-
if (ss.STARTING_SCREEN_HEIGHT != 0)
124-
{
125-
// There is blackspaces on the vertical axis. (top and bottom)
126-
if (blackspace_h_valid)
127-
newHeight -= blackspace_height;
128-
// Otherwise should be on the horizontal axis. (left and right)
129-
else
130-
newHeight += blackspace_width;
131-
}
132-
}
97+
float newWidth = ss.STARTING_SCREEN_WIDTH;
98+
float newHeight = ss.STARTING_SCREEN_HEIGHT;
13399

134100
float currentWidth = mRectTransform.sizeDelta.x;
135101
float currentHeight = mRectTransform.sizeDelta.y;

0 commit comments

Comments
 (0)