Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 86b0360

Browse files
committed
Allow panels to be dragged further outside the game window
1 parent b57e5be commit 86b0360

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/UI/Panels/UIPanel.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,13 @@ public static void EnsureValidPosition(RectTransform panel)
154154
// Prevent panel going oustide screen bounds
155155
var halfW = Screen.width * 0.5f;
156156
var halfH = Screen.height * 0.5f;
157-
pos.x = Math.Max(-halfW, Math.Min(pos.x, halfW - panel.rect.width));
158-
pos.y = Math.Max(-halfH + panel.rect.height, Math.Min(pos.y, halfH));
157+
158+
pos.x = Math.Max(-halfW - panel.rect.width + 50, Math.Min(pos.x, halfW - 50));
159+
pos.y = Math.Max(-halfH + 50, Math.Min(pos.y, halfH));
159160

160161
panel.localPosition = pos;
161162
}
162163

163-
164-
165164
#region Save Data
166165

167166
public abstract void DoSaveToConfigElement();

0 commit comments

Comments
 (0)