Fix EA disclaimer popup v3: explicit canvas RT stretch for nested canvases
Commit 492b080's "fix" didn't work — it made things worse because
Commit 492b080’s “fix” didn’t work — it made things worse because
new GameObject(name, typeof(RectTransform)) pre-creates a default
100x100 RectTransform that Canvas then refuses to resize. When the
popup is a child of mainCanvas (which it is, because Show() is called
with mainCanvas.transform as parent), the RT inherits that 100x100
default and all child UI renders inside a tiny 100px box — which is
why the body text came out as a ~50px-wide vertical column.
DifficultyUnlockPopup works because it does plain new GameObject(name)
and lets Canvas create its own RectTransform (which for root-canvas-like
setups gets auto-sized full-screen).
Fix: match DifficultyUnlockPopup’s constructor pattern, then explicitly stretch the canvas RT to fill the parent with anchor 0..1 + zero offsets. Belt-and-suspenders: works whether the Canvas auto-sizes or not.
Verified in Unity Play Mode: dim backdrop covers screen, centered panel, title + body + button all render at intended sizes. Body text wraps at the rect edge instead of char-by-char.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Commit cc5eddd by astafford8488.