From: Richard Huang Date: Thu, 5 Jun 2014 14:52:41 +0000 (+0100) Subject: Fixed wrong scroll direction for mouse wheel event in ItemView and ScrollView X-Git-Tag: dali_1.0.0~68 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=1ab5a093a38b07a63a5b81ac0394d2ca10eb48d9 Fixed wrong scroll direction for mouse wheel event in ItemView and ScrollView [problem] ScrollView and ItemView are moving in the wrong direction for mouse wheel event. [solution] Fixed the scroll direction for mouse wheel event in ItemView and ScrollView. --- diff --git a/base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp index 779395e..ef9abeb 100644 --- a/base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp @@ -1105,7 +1105,7 @@ bool ItemView::OnMouseWheelEvent(const MouseWheelEvent& event) { Actor self = Self(); const Vector3 layoutSize = Self().GetCurrentSize(); - float layoutPositionDelta = GetCurrentLayoutPosition(0) + (event.z * mMouseWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor()); + float layoutPositionDelta = GetCurrentLayoutPosition(0) - (event.z * mMouseWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor()); float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout); mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition ); diff --git a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp index 30b67c8..2c5b61b 100644 --- a/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp +++ b/base/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp @@ -1993,14 +1993,14 @@ bool ScrollView::OnMouseWheelEvent(const MouseWheelEvent& event) if(mRulerX->GetType() == Ruler::Free) { // Free panning mode - targetScrollPosition.x -= event.z * mMouseWheelScrollDistanceStep.x; + targetScrollPosition.x += event.z * mMouseWheelScrollDistanceStep.x; ClampPosition(targetScrollPosition); ScrollTo(-targetScrollPosition); } else if(!mScrolling) { // Snap mode, only respond to the event when the previous snap animation is finished. - ScrollTo(GetCurrentPage() + event.z); + ScrollTo(GetCurrentPage() - event.z); } } else @@ -2009,14 +2009,14 @@ bool ScrollView::OnMouseWheelEvent(const MouseWheelEvent& event) if(mRulerY->GetType() == Ruler::Free) { // Free panning mode - targetScrollPosition.y -= event.z * mMouseWheelScrollDistanceStep.y; + targetScrollPosition.y += event.z * mMouseWheelScrollDistanceStep.y; ClampPosition(targetScrollPosition); ScrollTo(-targetScrollPosition); } else if(!mScrolling) { // Snap mode, only respond to the event when the previous snap animation is finished. - ScrollTo(GetCurrentPage() + event.z * mRulerX->GetTotalPages()); + ScrollTo(GetCurrentPage() - event.z * mRulerX->GetTotalPages()); } }