Author Topic: Grid scrolling bug when recycling  (Read 2968 times)

sonee

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Grid scrolling bug when recycling
« on: November 26, 2013, 02:47:55 AM »
There is a grid in a panel and the grid is recycled whenever changing tab. When two tabs have similar draggable items, the visible area is recalculated automatically by calling Reposition function to prevent that nothing is appeared caused by different number of grid items between tabs.
But the problem is appeared when the difference of item counts between two tabs is big. For example, tab A contains 100 items and current scroll value is set to show last item(100th) then clicking tab B which contains 2 items shows nothing because of the scroll value even though the Reposition function has been called manually. But it works fine when the difference is similar or same(Usually, the scroll value is changed to show new items)
I've searched similar issues here, and solutions there don't work for me. Have you got this kind of issues before?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Grid scrolling bug when recycling
« Reply #1 on: November 26, 2013, 03:20:53 AM »
I am not sure if I understand your issue correctly, but if it is what I think it is, open up UIDrawCall, navigate to the line that reads:
  1. if (mClipping != Clipping.None) mMesh.RecalculateBounds();
...and change it to just:
  1. mMesh.RecalculateBounds();

sonee

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 11
    • View Profile
Re: Grid scrolling bug when recycling
« Reply #2 on: November 26, 2013, 03:55:47 AM »
Sorry, I got confused. That's the issue related to the UIScrollView.ResetPosition function. I thought that scrolling DraggablePanel changes the transform of a gameobject containing UIGrid. Resolved. Thanks.