I'm extending the UISprite to make a progress-bar like the Dota2's HP-bar.
What I've done is to make a subclass of UISprite and override the
OnFill method:
1. It can set the tiling numbers, like: I want one green-block for 100 hp, so 1200hp will need to be 12-tiles.
2. Each tile-block is sliced;
This picture is what I've made for now.

The problem is, that there's a extra green line at the 50% position.
After some digging in the code, I've found that it's from
UISprite.drawingDimensions,
float vx = Mathf.Lerp(x0, x1 - fw, mDrawRegion.x);
float vy = Mathf.Lerp(y0, y1 - fh, mDrawRegion.y);
float vz = Mathf.Lerp(x0 + fw, x1, mDrawRegion.z);
float vw = Mathf.Lerp(y0 + fh, y1, mDrawRegion.w);
I cannot really grasp why the vz is from
x0 + fw to
x1.
Assume I set the fillAmount to
0.5 with UISlider, and with this fomula, if the source sprite data has borders, I'm going to get the result image to go past the mid point, like in the picture below.
(This is what an original UISprite looks like when fillAmount = 0.5, you can see it go past the mid point obviously)
Is it an expected behaviour or a bug?