I've been experiensing some random bugs with UIGrid with "smooth animate" enabled when some items overlapped.
A digging through the NGUI code lead me to the reason.
So, I've found that there was a situation where the Spring component was disabled, but its target was very far from the real point of the object.
Then, I've discovered that somebody changed the spring's target after the initial setup.
And here's the code:
UIGrid.cs:414
SpringPosition sp = t.GetComponent<SpringPosition>();
if (sp != null)
{
sp.target.x -= fx;
sp.target.y -= fy;
}
This piece of code changed the spring's target, but didn't force Spring to be enabled. So, if the Spring component was disabled by this time, nobody enabled it and it didn't move the item to the target point.
So, I needed to add something like:
sp.target.x -= fx;
sp.target.y -= fy;
sp.UpdateTarget();
and also add a method to SpringPosition.cs:
public void UpdateTarget()
{
mThreshold = 0f;
enabled = true;
}
Also, seems that UITable.cs : 277 will cause the same issue.