Author Topic: UIScrollView ignoring movement restriction bug  (Read 2165 times)

BobbyPS

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
UIScrollView ignoring movement restriction bug
« 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView ignoring movement restriction bug
« Reply #1 on: April 10, 2014, 07:29:35 AM »
Thanks, I'll add it in.