Hey guys
We have a scenario where we have a UILabel with a UIInput as an immediate child to a UIScrollView panel.
In editor, changing the text value of the label causes the UIScrollView bounds (the orange box) to be recalculated, which is ideal. However, while running the scene, the bounds do not seem to update.
I'm not sure why this behaviour would be different while playing, but it seems to me that the reason the bounds aren't being recalculated is because of the following property in UIScrollView:
/// <summary>
/// Calculate the bounds used by the widgets.
/// </summary>
public virtual Bounds bounds
{
get
{
if (!mCalculatedBounds)
{
mCalculatedBounds = true;
mTrans = transform;
mBounds = NGUIMath.CalculateRelativeWidgetBounds(mTrans, mTrans);
}
return mBounds;
}
}
I can't imagine it being particularly expensive to calculate the bounds for a few rects. Perhaps we could have the option to disable caching bounds in the inspector?
For now I believe I can work around this by calling InvalidateBounds() as needed.
Thanks,
Ves