X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=dali-toolkit%2Finternal%2Fdrag-drop-detector%2Fdrag-and-drop-detector-impl.cpp;h=5592004840cadd430024a5eeea2ac7cf947533c4;hb=14455946a98df9b2f7cc5e9d5a972250da70a003;hp=f1aec26c51b278b6bf07b9a1236f180fa10c94d8;hpb=d37f5d8ff0d554b566dfbcdc765a681123cbf4e8;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp b/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp old mode 100755 new mode 100644 index f1aec26..5592004 --- a/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp +++ b/dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ #include #include -#include +#include namespace Dali { @@ -123,9 +123,11 @@ void DragAndDropDetector::OnPan(Dali::Actor actor, const PanGesture& gesture) { Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor); - if(gesture.state == Gesture::Started) + Gesture::State state = gesture.GetState(); + + if(state == Gesture::Started) { - mDragLocalPosition = gesture.position; + mDragLocalPosition = gesture.GetPosition(); mPointDown = true; mDragControl = control; mFirstEnter.clear(); @@ -144,23 +146,23 @@ void DragAndDropDetector::OnPan(Dali::Actor actor, const PanGesture& gesture) mShadowControl.SetProperty( Actor::Property::PARENT_ORIGIN, control.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ) ); mShadowControl.SetProperty( Actor::Property::ANCHOR_POINT,control.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); control.GetParent().Add(mShadowControl); - SetPosition(gesture.screenPosition); + SetPosition(gesture.GetScreenPosition()); EmitStartedSignal(control); } - if(gesture.state == Gesture::Continuing) + if(state == Gesture::Continuing) { - Vector2 screenPosition = gesture.screenPosition; + Vector2 screenPosition = gesture.GetScreenPosition(); control.GetParent().ScreenToLocal(mLocalPosition.x, mLocalPosition.y, screenPosition.x, screenPosition.y); mShadowControl.SetProperty( Actor::Property::POSITION, Vector2(mLocalPosition.x - mDragLocalPosition.x, mLocalPosition.y - mDragLocalPosition.y)); } - if(gesture.state == Gesture::Finished) + if(state == Gesture::Finished) { mDragControl.GetParent().Remove(mShadowControl); EmitEndedSignal(control); } } -bool DragAndDropDetector::OnDrag(Dali::Actor actor, const Dali::TouchData& data) +bool DragAndDropDetector::OnDrag(Dali::Actor actor, const Dali::TouchEvent& data) { Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(actor); PointState::Type type = data.GetState(0); @@ -209,7 +211,7 @@ bool DragAndDropDetector::OnDrag(Dali::Actor actor, const Dali::TouchData& data) } mPointDown = false; } - return true; + return false; } const std::string& DragAndDropDetector::GetContent() const