Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: BobbyPS on April 10, 2014, 02:43:32 AM

Title: UIScrollView ignoring movement restriction bug
Post by: BobbyPS on April 10, 2014, 02:43:32 AM
Hi there!  Very useful package.  Just ran into a bug and figured I would share.  There is a bug in the UIScrollView, line 746, instead of:
  1. if (offset.x != 0f || offset.y != 0f)
it needs to be:
  1. if (offset.x != 0f || offset.y != 0f || offset.z != 0f)

As the offset is still in world-space when that check is made, so for instance if you have a scroll-view and uicamera that have a 90 degree rotation around the y-axis, a horizontal dragging movement will be on the z-axis, which won't enter inside that if-statement in order to be clamped to zero by the movement restrictions, so your scroll view can start moving horizontally even if you have the movement direction set to vertical only.
Title: Re: UIScrollView ignoring movement restriction bug
Post by: ArenMook on April 10, 2014, 07:29:35 AM
Thanks, I'll add it in.