Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: avatara359 on October 19, 2015, 04:26:17 PM

Title: Fix for UILabel arguement out of range exception
Post by: avatara359 on October 19, 2015, 04:26:17 PM
Hello, we locally fixed an NGUI in UILabel for an "out of range exception" in "static void OnFontChanged (Font font)"

UILabel:958 for (int i = 0; i < mList.size; ++i) should be for (int i = 0; i < mList.size; i++)

UILabel:983 for (int i = 0, imax = mTempPanelList.Count; i < imax; ++i)
should be for (int i = 0; i < mTempPanelList.Count; i++)

for some reason there is a rare case where mTempPanelList will still get an out of bounds exception even with just a i++ change. This would imply that mTempPanelList is being changed at runtime by something. Logically I don't understand how this can be since its only used as a local temporary space.
Title: Re: Fix for UILabel arguement out of range exception
Post by: ArenMook on October 24, 2015, 04:29:44 AM
Uh... i++ or ++i, the result is the same. i++ makes a copy of the value that's then returned after the original one gets incremented. ++i increments, then returns, no copy value needs to be created. Regardless of which code is used, the for loop's functionality remains identical.

There is also no "mTempPanelList" in NGUI. You should update...