Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: sonee on November 26, 2013, 02:47:55 AM

Title: Grid scrolling bug when recycling
Post by: sonee 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?
Title: Re: Grid scrolling bug when recycling
Post by: ArenMook 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();
Title: Re: Grid scrolling bug when recycling
Post by: sonee 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.