Hi Aren,
Found some bugs that might need a little fix:
1. NGUIMath.cs, CalculateRelativeWidgetBounds() will generate a wrong out put in 2.1.4, when no NGUI widgets were found in children of UITable.
in line 332:
if (widgets
.Length == 0) return new Bounds
(root
.position, Vector3
.zero);
should not use root.position since it's a "Relative" bound, might be a wrong copy&paste when upgrading to 2.1.4, older versions used Vector3.zero and that should be the right value for default.
2. UIFont.cs , WrapText() will miss calculate the width of some texts like "[System]" in the text, and it will be calculated as a color tag and leads to wrong line wrapping.
in line 602:
we should double check its a valid color tag. I used something like this:
if (NGUITools.EncodeColor(NGUITools.ParseColor(text, offset + 1)) == text.Substring(offset + 1, 6).ToUpper())
{
offset += 7;
continue;
}
3.NGUITools.cs, ParseSymbol(). Same bug happened here, when parsing color tags, should double check it
line 191:
Color c = ParseColor(text, index + 1);
c.a = colors[colors.Count - 1].a
colors.Add(c);
I used the same trick to fix that:
Color c = ParseColor(text, index + 1);
if (EncodeColor(c) != text.Substring(index + 1, 6).ToUpper())
return 0;
c.a = colors[colors.Count - 1].a
colors.Add(c);