public override void MakePixelPerfect ()
{
if (ambigiousFont != null)
{
float pixelSize = (trueTypeFont != null) ? 1f : bitmapFont.pixelSize;
Vector3 pos = cachedTransform.localPosition;
pos.x = Mathf.RoundToInt(pos.x);
pos.y = Mathf.RoundToInt(pos.y);
pos.z = Mathf.RoundToInt(pos.z);
cachedTransform.localPosition = pos;
cachedTransform.localScale = Vector3.one;
if (mOverflow == Overflow.ResizeFreely)
{
AssumeNaturalSize();
}
else
{
int w = width;
int h = height;
Overflow over = mOverflow;
mOverflow = Overflow.ShrinkContent;
mWidth = 100000;
mHeight = 100000;
ProcessText(false);
mOverflow = over;
int minX = Mathf.RoundToInt(mCalculatedSize.x * pixelSize);
int minY = Mathf.RoundToInt(mCalculatedSize.y * pixelSize);
minX = Mathf.Max(minX, base.minWidth);
minY = Mathf.Max(minY, base.minHeight);
mWidth = Mathf.Max(w, minX);
mHeight = Mathf.Max(h, minY);
MarkAsChanged();
}
}
else base.MakePixelPerfect();
}