Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Quarkism on May 24, 2013, 12:03:16 PM
Title:
BUG : UICenterOnChild not recentering with mouse scroll wheel
Post by:
Quarkism
on
May 24, 2013, 12:03:16 PM
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
Title:
Re: BUG : UICenterOnChild not recentering with mouse scroll wheel
Post by:
Quarkism
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
if
(
onDragFinished
!=
null
)
onDragFinished
(
)
// In Context
// Restrict the contents to be within the panel's bounds
if
(
restrictWithinPanel
&&
mPanel
.
clipping
!=
UIDrawCall
.
Clipping
.
None
)
RestrictWithinBounds
(
false
)
;
if
(
onDragFinished
!=
null
)
onDragFinished
(
)
;
return
;
Title:
Re: BUG : UICenterOnChild not recentering with mouse scroll wheel
Post by:
ArenMook
on
May 24, 2013, 05:01:26 PM
Doesn't this change make it run the callback every time it moves?
Title:
Re: BUG : UICenterOnChild not recentering with mouse scroll wheel
Post by:
Quarkism
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.