uifw/EikStd/coctlsrc/aknedwinphysicshandler.cpp
branchRCL_3
changeset 10 9f56a4e1b8ab
parent 9 aabf2c525e0f
child 15 08e69e956a8c
equal deleted inserted replaced
9:aabf2c525e0f 10:9f56a4e1b8ab
    85         iViewRect.Contains( aPointerEvent.iPosition ) )
    85         iViewRect.Contains( aPointerEvent.iPosition ) )
    86         {
    86         {
    87         // Pointer down inside view rect, set flag to allow dragging 
    87         // Pointer down inside view rect, set flag to allow dragging 
    88         // and initialize values
    88         // and initialize values
    89         iFlags.Set( EFlagDraggingAllowed );
    89         iFlags.Set( EFlagDraggingAllowed );
    90         iPrevPosition = aPointerEvent.iPosition;
       
    91         iStartPosition = aPointerEvent.iPosition;
    90         iStartPosition = aPointerEvent.iPosition;
    92         StopPhysics();
    91         StopPhysics();
    93 
    92 
    94         iStartTime.HomeTime();
    93         iStartTime.HomeTime();
    95         iDragThresholdExceeded = EFalse;
    94         iDragThresholdExceeded = EFalse;
   110             if ( Abs( drag ) > DragThreshold() )
   109             if ( Abs( drag ) > DragThreshold() )
   111                 {
   110                 {
   112                 iDragThresholdExceeded = ETrue;
   111                 iDragThresholdExceeded = ETrue;
   113                 }
   112                 }
   114             }
   113             }
   115 
   114         else
   116         if ( iDragThresholdExceeded )
       
   117             {
   115             {
   118             TInt deltaY( iPrevPosition.iY - aPointerEvent.iPosition.iY );
   116             TInt deltaY( iPrevPosition.iY - aPointerEvent.iPosition.iY );
   119             iPrevPosition = aPointerEvent.iPosition;
       
   120 
   117 
   121             TPoint deltaPoint( 0, deltaY );
   118             TPoint deltaPoint( 0, deltaY );
   122             iPhysics->RegisterPanningPosition( deltaPoint );
   119             iPhysics->RegisterPanningPosition( deltaPoint );
   123             }
   120             }
       
   121 
       
   122         iPrevPosition = aPointerEvent.iPosition;
   124         }
   123         }
   125     else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
   124     else if ( aPointerEvent.iType == TPointerEvent::EButton1Up )
   126         {
   125         {
   127         if ( iFlags.IsClear( EFlagDraggingAllowed ) )
   126         if ( iFlags.IsClear( EFlagDraggingAllowed ) )
   128             {
   127             {
   240     // If bounce is ongoing, block all pointer events.
   239     // If bounce is ongoing, block all pointer events.
   241     if ( IsBouncing() )
   240     if ( IsBouncing() )
   242         {
   241         {
   243         BlockEvents( ETrue );
   242         BlockEvents( ETrue );
   244         }
   243         }
   245     // Scroll view based on values from aknphysics
   244     
       
   245     // Disable background drawing while panning or flicking. Instead,
       
   246     // background is drawn in one frame.
       
   247     iEdwin.DrawViewBackground( ETrue );
   246     ScrollView( ETrue );
   248     ScrollView( ETrue );
       
   249     iEdwin.DrawViewBackground( EFalse );
   247     }
   250     }
   248 
   251 
   249 // ---------------------------------------------------------------------------
   252 // ---------------------------------------------------------------------------
   250 // CAknEdwinPhysicsHandler::PhysicEmulationEnded
   253 // CAknEdwinPhysicsHandler::PhysicEmulationEnded
   251 // ---------------------------------------------------------------------------
   254 // ---------------------------------------------------------------------------