/// <summary> /// update the content transform size immediately. /// </summary> public void UpdateContentSize() { var contentRect = layoutCalculator.GetContentRect(); this.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, contentRect.height); this.content.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, contentRect.width); }
public Rect GetContentRect() { var innerContentRect = _innerLayout.GetContentRect(); return(new Rect(Vector2.zero, innerContentRect.size + new Vector2(padding.horizontal, padding.vertical))); }