Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ryan on January 24, 2013, 09:15:49 PM

Title: Draggable panel with scrollbar, "when dragging" doesn't include scrolling?
Post by: ryan on January 24, 2013, 09:15:49 PM
So I've got a draggable panel with a scrollbar, and the panel is set to only show the scrollbar when dragging.  That works great, but if I use the scroll wheel, this doesn't make the scrollbar visible like I would expect from a native Mac app.  I changed line 603 of UIDraggablePanel from this:

  1. if (showScrollBars != ShowCondition.WhenDragging || mDragID != -10)
  2.  

to this:

  1. if (showScrollBars != ShowCondition.WhenDragging || mDragID != -10 || mMomentum.magnitude > 0.01f)
  2.  

which makes the scrollbar visible while using the scroll wheel, and has the added benefit of leaving it visible after a drag while momentum is still being applied.  That threshold could maybe be tuned a little bit.  I started with 0.0001f as is used a few lines further down in the class, but that left the bar showing for a bit too long.  Any chance this, or a similar change, could be incorporated?
Title: Re: Draggable panel with scrollbar, "when dragging" doesn't include scrolling?
Post by: ArenMook on January 25, 2013, 10:30:10 AM
Yup, I will add it in.