Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: jingato on May 20, 2014, 02:59:08 PM

Title: UIScrollView UpdatePosition
Post by: jingato on May 20, 2014, 02:59:08 PM
Hi, I just updated to the latest NGUI and noticed my scrollviews were no longer acting as normal. Looking at the code it looks like you aded additional conditions on the UpdatePosition function that requires it to have a scrollbar.

  1. public void UpdatePosition ()
  2.         {
  3.                 if (!mIgnoreCallbacks && (horizontalScrollBar != null || verticalScrollBar != null))
  4.                 {
  5.                 }
  6.         }
  7.  

I was wondering why you added this condition and if there is something else we should now be using to update the position or if I should remove this condition.

Thanks
Title: Re: UIScrollView UpdatePosition
Post by: ArenMook on May 20, 2014, 04:20:59 PM
It's a function that gets called by scroll bars, which is why the check is there. I believe the check was added because it's also used in UIPanel.baseClipRegion, and it doesn't reset the position properly at edit time otherwise.