Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rocman

Pages: [1]
1
It's useful to do this sometimes.

2
NGUI 3 Support / what kind of unit is the delta of OnDrag (delta) in?
« on: March 16, 2014, 05:40:09 AM »
when i test in my cell phone, the delta seems not count by pixel

3
NGUI 3 Support / Re: a bug report of NGUI's ScrollView Component
« on: February 13, 2014, 05:54:50 AM »
Big Thx to your quick response  :D

4
NGUI 3 Support / a bug report of NGUI's ScrollView Component
« on: February 13, 2014, 01:22:06 AM »
Here's a bug report of NGUI's ScrollView Component.

If a scroll view is anchored, and if the anchoring makes the baseClipRegion of it changed, the contents in the scroll view will be wrongly positioned.

And here's my solution:

Since the bug happens in the case of baseClipRegion changing, it seems ok to fix it by calling the method "ResetPosition" which is to fix the position of the contents when baseClipRegion is changed.

So the following is the key code:

UIPanel.cs
public Vector4 baseClipRegion
{
   get
   {
      return mClipRange;
   }
   set
   {
      if (Mathf.Abs(mClipRange.x - value.x) > 0.001f ||
         Mathf.Abs(mClipRange.y - value.y) > 0.001f ||
         Mathf.Abs(mClipRange.z - value.z) > 0.001f ||
         Mathf.Abs(mClipRange.w - value.w) > 0.001f)
      {
         mResized = true;
         mCullTime = (mCullTime == 0f) ? 0.001f : RealTime.time + 0.15f;
------------------------------------------ before ------------------------------------------
         mClipRange = value;
------------------------------------------ after -------------------------------------------
         if (mClipRange != value)
         {
            mClipRange = value;
            var scrollViewComponent = this.GetComponent<UIScrollView>();
            if (scrollViewComponent != null)
            {
               scrollViewComponent.ResetPosition();
            }
         }
---------------------------------------------------------------------------------------------

         mMatrixFrame = -1;
#if UNITY_EDITOR
         if (!Application.isPlaying) UpdateDrawCalls();
#endif
      }
   }
}

Hopes this bug can be fixed at next version of NGUI, and so I don't have to member to change the code myself.
Looking forward to your replying.

Pages: [1]