mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-04 04:22:53 +08:00
Fix UIPanels being broken after resolution changes, better checks on size/position
This commit is contained in:
@ -51,7 +51,7 @@ namespace UnityExplorer.UI.Panels
|
||||
|
||||
if (active && !DoneScrollPoolInit)
|
||||
{
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(this.mainPanelRect);
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(this.Rect);
|
||||
logScrollPool.Initialize(this);
|
||||
DoneScrollPoolInit = true;
|
||||
}
|
||||
@ -158,10 +158,10 @@ namespace UnityExplorer.UI.Panels
|
||||
|
||||
protected internal override void DoSetDefaultPosAndAnchors()
|
||||
{
|
||||
mainPanelRect.localPosition = Vector2.zero;
|
||||
mainPanelRect.pivot = new Vector2(0f, 1f);
|
||||
mainPanelRect.anchorMin = new Vector2(0.5f, 0.03f);
|
||||
mainPanelRect.anchorMax = new Vector2(0.9f, 0.2f);
|
||||
Rect.localPosition = Vector2.zero;
|
||||
Rect.pivot = new Vector2(0f, 1f);
|
||||
Rect.anchorMin = new Vector2(0.5f, 0.03f);
|
||||
Rect.anchorMax = new Vector2(0.9f, 0.2f);
|
||||
}
|
||||
|
||||
// UI Construction
|
||||
|
Reference in New Issue
Block a user