Author Topic: UIScrollView UpdatePosition  (Read 1816 times)

jingato

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 15
    • View Profile
UIScrollView UpdatePosition
« 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView UpdatePosition
« Reply #1 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.