transform.RotateAround not reversing

I want to rotate around an object with the camera and the gesture code works on doing that to a certain extend. This is the code:

		if (gesture.deltaPosition.x>0)
		{
			rotationX -= gesture.deltaPosition.x*Time.deltaTime;
			transform.RotateAround( referenceCamera.up, Mathf.Deg2Rad * rotationX);
			Debug.Log ("To left x="+gesture.deltaPosition.x);
		}
		else if (gesture.deltaPosition.x<0)
		{				
			rotationX -= gesture.deltaPosition.x*Time.deltaTime;
			transform.RotateAround( referenceCamera.up, Mathf.Deg2Rad * rotationX);
			Debug.Log ("To right x="+gesture.deltaPosition.x);
		}

		else
		{
		}

		if (gesture.deltaPosition.y>0)
		{				
			rotationY += gesture.deltaPosition.y*Time.deltaTime;
			transform.RotateAround( referenceCamera.right, Mathf.Deg2Rad * rotationY);
			Debug.Log ("Positive y="+gesture.deltaPosition.y);
		}
		else if (gesture.deltaPosition.y<0)
		{				
			rotationY += gesture.deltaPosition.y*Time.deltaTime;
			transform.RotateAround( referenceCamera.right, Mathf.Deg2Rad * rotationY);
			Debug.Log ("Negative y="+gesture.deltaPosition.y);
		}
		else
		{
		}

The problem is that if you are moving to one direction, and you reverse the gesture, the movement is still towards the first direction for a while, even with the Debug telling me that deltaPosition has inverted. I am confused here. Any help?
Regards
Carlos

You’re doing an accelerated rotation here. So if you move in one direction you increase rotation it it’s getting bigger and bigger while you move. If you reverse your movement rotation is getting smaller and smaller bit is still positive. Once you have it down to 0 it’s starts getting negative.

You might want to overthink your logic here and what exact behaviour you want.