Refactoring Gestures Class 85/236885/13
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 23 Jun 2020 06:18:28 +0000 (15:18 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 1 Sep 2020 15:59:46 +0000 (16:59 +0100)
Change-Id: I945af40bbb1a62177fe6bcfeda3c6a85396b90f3

15 files changed:
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp [changed mode: 0755->0644]
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp [changed mode: 0755->0644]
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp [changed mode: 0755->0644]
dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.cpp
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/text-controller-impl.cpp [changed mode: 0755->0644]
dali-toolkit/public-api/controls/control-impl.cpp

index 3d4fd83..ebba4e9 100644 (file)
@@ -686,6 +686,18 @@ int UtcDaliToolkitScrollModeP1(void)
   // Confirm the final X coord has snapped to exactly one page ahead of the start page.
   DALI_TEST_EQUALS( viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
 
+  // Change scroll mode during pan, should not crash
+  PerformGestureSwipe( application, startPos, direction, frames - 1, time, false );
+  try
+  {
+    scrollView.SetScrollSensitive(false);
+    DALI_TEST_CHECK(true);
+  }
+  catch(...)
+  {
+    DALI_TEST_CHECK(false);
+  }
+
   END_TEST;
 }
 
index b01a27f..cb8d8bb 100644 (file)
@@ -1745,6 +1745,13 @@ int utcDaliTextEditorEvent03(void)
   application.SendNotification();
   application.Render();
 
+  // Pan Press
+  TestGenerateMiniPan(application);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
   END_TEST;
 }
 
@@ -2416,6 +2423,15 @@ int utcDaliTextEditorHandles(void)
   application.SendNotification();
   application.Render();
 
+  // Pan the grab handle
+  uint32_t time = 100;
+  TestStartPan( application, Vector2(10.0f, 50.0f), Vector2(10.0f, 50.0f), time );
+  TestMovePan( application, Vector2(10.0f, 30.0f), time );
+  TestEndPan( application, Vector2(10.0f, 50.0f), time);
+  application.SendNotification();
+  application.Render();
+
+
   // Release the grab handle.
   event = Dali::Integration::TouchEvent();
   event.AddPoint( GetPointUpInside( touchPos ) );
index 2a6484b..b19ab8d 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/devel-api/adaptor-framework/sound-player.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/devel-api/events/hit-test-algorithm.h>
+#include <dali/devel-api/events/pan-gesture-devel.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -1331,14 +1332,12 @@ bool AccessibilityManager::HandlePanGesture(const AccessibilityGestureEvent& pan
 
   Actor rootActor = Stage::GetCurrent().GetRootLayer();
 
-  Dali::PanGesture pan( static_cast<Dali::Gesture::State>(panEvent.state) );
-
-  pan.time = panEvent.time;
-  pan.numberOfTouches = panEvent.numberOfTouches;
-  pan.screenPosition = panEvent.currentPosition;
-  pan.screenDisplacement = mPreviousPosition - panEvent.currentPosition;
-  pan.screenVelocity.x = pan.screenDisplacement.x / panEvent.timeDelta;
-  pan.screenVelocity.y = pan.screenDisplacement.y / panEvent.timeDelta;
+  Dali::PanGesture pan = DevelPanGesture::New( static_cast<Dali::Gesture::State>(panEvent.state) );
+  DevelPanGesture::SetTime( pan, panEvent.time );
+  DevelPanGesture::SetNumberOfTouches( pan, panEvent.numberOfTouches  );
+  DevelPanGesture::SetScreenPosition( pan, panEvent.currentPosition );
+  DevelPanGesture::SetScreenDisplacement( pan, mPreviousPosition - panEvent.currentPosition );
+  DevelPanGesture::SetScreenVelocity( pan, Vector2( pan.GetScreenDisplacement().x / panEvent.timeDelta, pan.GetScreenDisplacement().y / panEvent.timeDelta ) );
 
   // Only handle the pan gesture when the current focused actor is scrollable or within a scrollable actor
   while(mCurrentGesturedActor && mCurrentGesturedActor != rootActor && !handled)
@@ -1348,14 +1347,13 @@ bool AccessibilityManager::HandlePanGesture(const AccessibilityGestureEvent& pan
     {
       Vector2 localCurrent;
       control.ScreenToLocal( localCurrent.x, localCurrent.y, panEvent.currentPosition.x, panEvent.currentPosition.y );
-      pan.position = localCurrent;
+      DevelPanGesture::SetPosition( pan, localCurrent );
 
       Vector2 localPrevious;
       control.ScreenToLocal( localPrevious.x, localPrevious.y, mPreviousPosition.x, mPreviousPosition.y );
 
-      pan.displacement = localCurrent - localPrevious;
-      pan.velocity.x = pan.displacement.x / panEvent.timeDelta;
-      pan.velocity.y = pan.displacement.y / panEvent.timeDelta;
+      DevelPanGesture::SetDisplacement( pan, localCurrent - localPrevious );
+      DevelPanGesture::SetVelocity( pan, Vector2( pan.GetDisplacement().x / panEvent.timeDelta, pan.GetDisplacement().y / panEvent.timeDelta ));
 
       handled = GetImplementation( control ).OnAccessibilityPan(pan);
     }
index 4cba4af..2964578 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 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.
@@ -612,19 +612,20 @@ void PageTurnView::RemovePage( int pageIndex )
 void PageTurnView::OnPan( const PanGesture& gesture )
 {
   // the pan gesture is attached to control itself instead of each page
-  switch( gesture.state )
+  switch( gesture.GetState() )
   {
     case Gesture::Started:
     {
       // check whether the undergoing turning page number already reaches the maximum allowed
       if( mPageUpdated && mAnimatingCount< MAXIMUM_TURNING_NUM && mSlidingCount < 1 )
       {
-        SetPanActor( gesture.position ); // determine which page actor is panned
+        const Vector2& position = gesture.GetPosition();
+        SetPanActor( position ); // determine which page actor is panned
         if( mTurningPageIndex != -1 && mPages[mTurningPageIndex % NUMBER_OF_CACHED_PAGES].actor.GetParent() != Self()) // if the page is added to turning layer,it is undergoing an animation currently
         {
           mTurningPageIndex = -1;
         }
-        PanStarted( SetPanPosition( gesture.position ) );  // pass in the pan position in the local page coordinate
+        PanStarted( SetPanPosition( position ) );  // pass in the pan position in the local page coordinate
       }
       else
       {
@@ -634,13 +635,13 @@ void PageTurnView::OnPan( const PanGesture& gesture )
     }
     case Gesture::Continuing:
     {
-      PanContinuing( SetPanPosition( gesture.position ) ); // pass in the pan position in the local page coordinate
+      PanContinuing( SetPanPosition( gesture.GetPosition() ) ); // pass in the pan position in the local page coordinate
       break;
     }
     case Gesture::Finished:
     case Gesture::Cancelled:
     {
-      PanFinished( SetPanPosition( gesture.position ), gesture.GetSpeed() );
+      PanFinished( SetPanPosition( gesture.GetPosition() ), gesture.GetSpeed() );
       break;
     }
     case Gesture::Clear:
old mode 100755 (executable)
new mode 100644 (file)
index c4b2581..c588487
@@ -195,7 +195,7 @@ ScrollBar::ScrollBar(Toolkit::ScrollBar::Direction direction)
   mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
   mTransientIndicatorDuration(DEFAULT_INDICATOR_TRANSIENT_DURATION),
   mScrollStart(0.0f),
-  mGestureDisplacement( Vector3::ZERO ),
+  mGestureDisplacement( Vector2::ZERO ),
   mCurrentScrollPosition(0.0f),
   mIndicatorHeightPolicy(Toolkit::ScrollBar::VARIABLE),
   mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT),
@@ -459,9 +459,9 @@ void ScrollBar::OnPan( const PanGesture& gesture )
   {
     Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast(scrollableHandle);
 
-    switch(gesture.state)
+    switch(gesture.GetState())
     {
-      case Gesture::Started:
+      case Dali::Gesture::Started:
       {
         if( !mPanProcessTimer )
         {
@@ -473,15 +473,14 @@ void ScrollBar::OnPan( const PanGesture& gesture )
 
         ShowIndicator();
         mScrollStart = scrollableHandle.GetCurrentProperty< float >( mPropertyScrollPosition );
-        mGestureDisplacement = Vector3::ZERO;
+        mGestureDisplacement = Vector2::ZERO;
         mIsPanning = true;
 
         break;
       }
-      case Gesture::Continuing:
+      case Dali::Gesture::Continuing:
       {
-        mGestureDisplacement.x += gesture.displacement.x;
-        mGestureDisplacement.y += gesture.displacement.y;
+        mGestureDisplacement += gesture.GetDisplacement();
 
         float minScrollPosition = scrollableHandle.GetCurrentProperty<float>( mPropertyMinScrollPosition );
         float maxScrollPosition = scrollableHandle.GetCurrentProperty<float>( mPropertyMaxScrollPosition );
old mode 100755 (executable)
new mode 100644 (file)
index f56b9a0..3049227
@@ -295,7 +295,7 @@ private:
   float mTransientIndicatorDuration;                                 ///< The duration before hiding transient indicator
 
   float mScrollStart;                                                ///< Scroll Start position (start of drag)
-  Vector3 mGestureDisplacement;                                      ///< Gesture Displacement.
+  Vector2 mGestureDisplacement;                                      ///< Gesture Displacement.
 
   float mCurrentScrollPosition;                                      ///< The current scroll position updated by the pan gesture
 
index 939ab67..a06cee6 100644 (file)
@@ -1159,7 +1159,7 @@ void ItemView::OnPan( const PanGesture& gesture )
     return;
   }
 
-  mGestureState = gesture.state;
+  mGestureState = gesture.GetState();
 
   switch (mGestureState)
   {
@@ -1227,7 +1227,8 @@ void ItemView::OnPan( const PanGesture& gesture )
 
     case Gesture::Continuing:
     {
-      mScrollDistance = CalculateScrollDistance(gesture.displacement, *mActiveLayout);
+      const Vector2& displacement = gesture.GetDisplacement();
+      mScrollDistance = CalculateScrollDistance(displacement, *mActiveLayout);
       mScrollSpeed = Clamp((gesture.GetSpeed() * gesture.GetSpeed() * mActiveLayout->GetFlickSpeedFactor() * MILLISECONDS_PER_SECONDS), 0.0f, mActiveLayout->GetMaximumSwipeSpeed());
 
       // Refresh order depends on the direction of the scroll; negative is towards the last item.
@@ -1246,7 +1247,7 @@ void ItemView::OnPan( const PanGesture& gesture )
           ( firstItemScrollPosition <= mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), layoutSize) &&
             currentOvershoot > -1.0f ) )
       {
-        mTotalPanDisplacement += gesture.displacement;
+        mTotalPanDisplacement += displacement;
       }
 
       mScrollOvershoot = CalculateScrollOvershoot();
index 8b9d384..fb7e086 100644 (file)
@@ -28,6 +28,7 @@
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/devel-api/object/property-helper-devel.h>
+#include <dali/devel-api/events/pan-gesture-devel.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -1002,7 +1003,7 @@ void ScrollView::SetScrollSensitive(bool sensitive)
     // while the scroll view is panning, the state needs to be reset.
     if ( mPanning )
     {
-      PanGesture cancelGesture( Gesture::Cancelled );
+      PanGesture cancelGesture = DevelPanGesture::New( Gesture::Cancelled );
       OnPan( cancelGesture );
     }
 
@@ -2478,17 +2479,18 @@ void ScrollView::OnPan( const PanGesture& gesture )
   }
 
   // translate Gesture input to get useful data...
-  switch(gesture.state)
+  switch(gesture.GetState())
   {
     case Gesture::Started:
     {
       DALI_LOG_SCROLL_STATE("[0x%X] Pan Started", this);
-      mPanStartPosition = gesture.position - gesture.displacement;
+      const Vector2& position = gesture.GetPosition();
+      mPanStartPosition = position - gesture.GetDisplacement();
       UpdateLocalScrollProperties();
       GestureStarted();
       mPanning = true;
       self.SetProperty( Toolkit::ScrollView::Property::PANNING, true );
-      self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(gesture.position.x, gesture.position.y, 0.0f) );
+      self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(position.x, position.y, 0.0f) );
 
       UpdateMainInternalConstraint();
       Toolkit::ScrollBar scrollBar = mScrollBar.GetHandle();
@@ -2511,7 +2513,7 @@ void ScrollView::OnPan( const PanGesture& gesture )
       if ( mPanning )
       {
         DALI_LOG_SCROLL_STATE("[0x%X] Pan Continuing", this);
-        GestureContinuing(gesture.screenDisplacement);
+        GestureContinuing(gesture.GetScreenDisplacement());
       }
       else
       {
@@ -2526,10 +2528,10 @@ void ScrollView::OnPan( const PanGesture& gesture )
     {
       if ( mPanning )
       {
-        DALI_LOG_SCROLL_STATE("[0x%X] Pan %s", this, ( ( gesture.state == Gesture::Finished ) ? "Finished" : "Cancelled" ) );
+        DALI_LOG_SCROLL_STATE("[0x%X] Pan %s", this, ( ( gesture.GetState() == Gesture::Finished ) ? "Finished" : "Cancelled" ) );
 
         UpdateLocalScrollProperties();
-        mLastVelocity = gesture.velocity;
+        mLastVelocity = gesture.GetVelocity();
         mPanning = false;
         self.SetProperty( Toolkit::ScrollView::Property::PANNING, false );
 
@@ -2561,7 +2563,7 @@ void ScrollView::OnPan( const PanGesture& gesture )
 
   } // end switch(gesture.state)
 
-  OnGestureEx(gesture.state);
+  OnGestureEx(gesture.GetState());
 }
 
 void ScrollView::OnGestureEx(Gesture::State state)
index 757bef8..8879549 100644 (file)
@@ -248,13 +248,13 @@ void Slider::OnPan( Actor actor, const PanGesture& gesture )
   // gesture.position is in local actor coordinates
   if( mState != DISABLED )
   {
-    switch( gesture.state )
+    switch( gesture.GetState() )
     {
       case Gesture::Continuing:
       {
         if( mState == PRESSED )
         {
-          float value = MapBounds( MarkFilter ( MapPercentage( gesture.position ) ), GetLowerBound(), GetUpperBound() );
+          float value = MapBounds( MarkFilter ( MapPercentage( gesture.GetPosition() ) ), GetLowerBound(), GetUpperBound() );
           SetValue( value );
           DisplayPopup( value );
         }
@@ -266,7 +266,7 @@ void Slider::OnPan( Actor actor, const PanGesture& gesture )
         {
           if( GetSnapToMarks() )
           {
-            float value = MapBounds( SnapToMark( MapPercentage( gesture.position ) ), GetLowerBound(), GetUpperBound() );
+            float value = MapBounds( SnapToMark( MapPercentage( gesture.GetPosition() ) ), GetLowerBound(), GetUpperBound() );
             SetValue( value );
             DisplayPopup( value );
           }
old mode 100755 (executable)
new mode 100644 (file)
index 2579f68..a6c6267
@@ -1576,14 +1576,15 @@ void TextEditor::OnTap( const TapGesture& gesture )
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
   Extents padding;
   padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
-  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+  const Vector2& localPoint = gesture.GetLocalPoint();
+  mController->TapEvent( gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
 
 void TextEditor::OnPan( const PanGesture& gesture )
 {
-  mController->PanEvent( gesture.state, gesture.displacement );
+  mController->PanEvent( gesture.GetState(), gesture.GetDisplacement() );
 }
 
 void TextEditor::OnLongPress( const LongPressGesture& gesture )
@@ -1594,7 +1595,8 @@ void TextEditor::OnLongPress( const LongPressGesture& gesture )
   }
   Extents padding;
   padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
-  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+  const Vector2& localPoint = gesture.GetLocalPoint();
+  mController->LongPressEvent( gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
old mode 100755 (executable)
new mode 100644 (file)
index 8f0381e..cd6eb21
@@ -1663,14 +1663,15 @@ void TextField::OnTap( const TapGesture& gesture )
   // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures
   Extents padding;
   padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
-  mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+  const Vector2& localPoint = gesture.GetLocalPoint();
+  mController->TapEvent( gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
 
 void TextField::OnPan( const PanGesture& gesture )
 {
-  mController->PanEvent( gesture.state, gesture.displacement );
+  mController->PanEvent( gesture.GetState(), gesture.GetDisplacement() );
 }
 
 void TextField::OnLongPress( const LongPressGesture& gesture )
@@ -1681,7 +1682,8 @@ void TextField::OnLongPress( const LongPressGesture& gesture )
   }
   Extents padding;
   padding = Self().GetProperty<Extents>( Toolkit::Control::Property::PADDING );
-  mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top );
+  const Vector2& localPoint = gesture.GetLocalPoint();
+  mController->LongPressEvent( gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top );
 
   SetKeyInputFocus();
 }
index 12d42fe..5592004 100644 (file)
@@ -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,16 +146,16 @@ 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);
index c22ffe7..e369158 100644 (file)
@@ -1259,7 +1259,8 @@ struct Decorator::Impl : public ConnectionTracker
 
   void DoPan( HandleImpl& handle, HandleType type, const PanGesture& gesture )
   {
-    if( Gesture::Started == gesture.state )
+    Gesture::State state = gesture.GetState();
+    if( Gesture::Started == state )
     {
       handle.grabDisplacementX = handle.grabDisplacementY = 0.f;
 
@@ -1267,15 +1268,16 @@ struct Decorator::Impl : public ConnectionTracker
       handle.globalPosition.y = handle.position.y;
     }
 
-    handle.grabDisplacementX += gesture.displacement.x;
-    handle.grabDisplacementY += ( handle.verticallyFlipped ? -gesture.displacement.y : gesture.displacement.y );
+    const Vector2& displacement = gesture.GetDisplacement();
+    handle.grabDisplacementX += displacement.x;
+    handle.grabDisplacementY += ( handle.verticallyFlipped ? -displacement.y : displacement.y );
 
     const float x = handle.globalPosition.x + handle.grabDisplacementX;
     const float y = handle.globalPosition.y + handle.grabDisplacementY + 0.5f * handle.lineHeight;
     const float yVerticallyFlippedCorrected = y - ( handle.verticallyFlippedOnTouch ? handle.lineHeight : 0.f );
 
-    if( ( Gesture::Started    == gesture.state ) ||
-        ( Gesture::Continuing == gesture.state ) )
+    if( ( Gesture::Started    == state ) ||
+        ( Gesture::Continuing == state ) )
     {
       Vector2 targetSize;
       mController.GetTargetSize( targetSize );
@@ -1317,8 +1319,8 @@ struct Decorator::Impl : public ConnectionTracker
 
       mIsHandlePanning = true;
     }
-    else if( ( Gesture::Finished  == gesture.state ) ||
-             ( Gesture::Cancelled == gesture.state ) )
+    else if( ( Gesture::Finished  == state ) ||
+             ( Gesture::Cancelled == state ) )
     {
       if( mScrollTimer &&
           ( mScrollTimer.IsRunning() || mNotifyEndOfScroll ) )
index b66cdd6..5897750 100644 (file)
@@ -507,12 +507,12 @@ void Control::OnPinch(const PinchGesture& pinch)
     mImpl->mStartingPinchScale = new Vector3;
   }
 
-  if( pinch.state == Gesture::Started )
+  if( pinch.GetState() == Gesture::Started )
   {
     *( mImpl->mStartingPinchScale ) = Self().GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
   }
 
-  Self().SetProperty( Actor::Property::SCALE, *( mImpl->mStartingPinchScale ) * pinch.scale );
+  Self().SetProperty( Actor::Property::SCALE, *( mImpl->mStartingPinchScale ) * pinch.GetScale() );
 }
 
 void Control::OnPan( const PanGesture& pan )