Author Topic: UIStretch with container  (Read 2067 times)

vei

  • Guest
UIStretch with container
« on: August 30, 2012, 04:41:14 AM »
Please correct me if I'm wrong :) Or sorry if someone has posted about this.

The current UIStretch doesn't work correctly for me if I set it based on widget container.
Then I see this line:

Quote
if (mRoot != null && !mRoot.automatic && rectHeight > 1f)
{
   float scale = mRoot.manualHeight / rectHeight;
   rectWidth *= scale;
   rectHeight *= scale;
}

Doesn't it equivalent to..
Quote
rectHeight = rectHeight * scale = rectHeight * mRoot.manualHeight / rectHeight = mRoot.manualHeight

So rectHeight always equals to mRoot.manualHeight. Maybe it should be changed to..
Quote
float scale = mRoot.manualHeight / uiCamera.pixelRect.height;

Just info ;D