Author Topic: UIWrapContent and UICenterOnChild NextPageThreshold  (Read 4089 times)

gw1108

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
UIWrapContent and UICenterOnChild NextPageThreshold
« on: July 31, 2014, 02:20:10 PM »
I think there's a bug where the NextPageThreshold does not center on the correct child in the example 14 Endless Scroll Views.unity using NGUI 3.6.4b when the user flicks. Only happens sometimes.

Steps:
1. Open example 14 Endless Scroll View.
2. Delete all children except 3 in a scroll view.
3. Attach UICenterOnChild to the same object as UIWrapContent.
4. Set the threshold of UICenterOnChild to non zero. Easiest to see if somewhere between 0.2 and 0.05.
5. Flick the modified scroll view down or up. SOMETIMES it centers the opposite direction expected.

I think a workaround is in UICenterOnChild change OnDragFinished () to invoke Recenter with a delay of 0.0f seconds instead of calling it immediately.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIWrapContent and UICenterOnChild NextPageThreshold
« Reply #1 on: August 01, 2014, 07:10:25 PM »
It likely centers on an object that then gets moved due to how endless scroll views work, so it ends up moving in the opposite direction. This particular feature (flicking to go to the next page) was meant for full-screen menus, not tiny items.

gw1108

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: UIWrapContent and UICenterOnChild NextPageThreshold
« Reply #2 on: August 01, 2014, 07:26:25 PM »
Upon further investigation step 2 was unnecessary. Sorry about that.

Steps:
1. Open example 14 Endless Scroll View.
2. Attach UICenterOnChild to the same object as UIWrapContent.
3. Set the threshold of UICenterOnChild to non zero. Easiest to see if somewhere between 0.25 and 0.1.
4. Flick the modified scroll view down or up. SOMETIMES it centers the opposite direction expected.

Also strangely if you first REMOVE the UIWrapContent the bug will still appear.
« Last Edit: August 01, 2014, 07:53:48 PM by gw1108 »