Hi,
I use a lot of UISliced buttons, but in many cases I just want to extend them in one direction (horizontal or vertical), while keeping the other direction fixed.
Suppose you have set up an expandable horizontal button that uses non-zero pixels for left/right setting and 0 pixels for bottom/top.
That means we don't want top/bottom border, we just want left and right border and, of course, the middle part of the button.
I noticed that in such cases what could be done with 2 * 3 (2 for left part, 2 for middle part, 2 for right part) triangles is being done with 2 * 3 * 3 (18 parts).
I made an improvement for UISlicedSprite.cs on function OnFill.
I would appreciate if you could commit this in the next versions of NGUI.
...
for (int x = 0; x < 3; ++x)
{
int x2 = x + 1;
// improvement 1
if (uv[x].x == uv[x2].x) continue;
for (int y = 0; y < 3; ++y)
{
if (!mFillCenter && x == 1 && y == 1) continue;
int y2 = y + 1;
// improvement 2
if (uv[y].y == uv[y2].y) continue;
...
Thanks in advance.