Author Topic: BUG : UICenterOnChild not recentering with mouse scroll wheel  (Read 4694 times)

Quarkism

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 48
    • View Profile
I think I found a bug! I've been able to replicate it in example 7 (clipping drag panel).

TL;DR
When use a mouse to scroll in a drag panel the recenter method is not being called.

Steps to replicate
  • Open Example 7
  • Pres Play
  • Check the 'center on item checkbox'
  • Drag; The drag panel should center correctly
  • Now use the mouse wheel scroll; It will not center correctly
« Last Edit: May 24, 2013, 01:24:41 PM by Quarkism »

Quarkism

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 48
    • View Profile
Re: BUG : UICenterOnChild not recentering with mouse scroll wheel
« Reply #1 on: May 24, 2013, 12:12:35 PM »
I hacked a fix. The solution was to add the following to line 676 of UIDraggablePanel.cs

//Code To Add
  1.  if (onDragFinished != null) onDragFinished()
  2.  

// In Context
  1.  
  2. // Restrict the contents to be within the panel's bounds
  3. if (restrictWithinPanel && mPanel.clipping != UIDrawCall.Clipping.None) RestrictWithinBounds(false);
  4. if (onDragFinished != null) onDragFinished();
  5. return;

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: BUG : UICenterOnChild not recentering with mouse scroll wheel
« Reply #2 on: May 24, 2013, 05:01:26 PM »
Doesn't this change make it run the callback every time it moves?

Quarkism

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 48
    • View Profile
Re: BUG : UICenterOnChild not recentering with mouse scroll wheel
« Reply #3 on: May 28, 2013, 12:21:03 PM »
Yeah I was thinking that, but functional and inefficient is better then broken and efficient. I was hoping you would have a better fix.