[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.
{
Actor self = Self();
const Vector3 layoutSize = Self().GetCurrentSize();
{
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 );
float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout);
mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
if(mRulerX->GetType() == Ruler::Free)
{
// Free panning mode
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.
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);
if(mRulerY->GetType() == Ruler::Free)
{
// Free panning mode
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.
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());