Fine-tuned drag&drop in magnifying glass mouse movement mode

This commit is contained in:
pelya
2011-10-10 18:17:14 +03:00
parent 7145c352a8
commit 7290ea9923

View File

@@ -517,11 +517,11 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j
{ {
if( moveMouseWithKbX >= 0 ) if( moveMouseWithKbX >= 0 )
{ {
if( abs(moveMouseWithKbX - x) > SDL_ANDROID_sFakeWindowWidth / 5 ) if( abs(moveMouseWithKbX - x) > SDL_ANDROID_sFakeWindowWidth / 12 )
moveMouseWithKbSpeedX += moveMouseWithKbX > x ? -1 : 1; moveMouseWithKbSpeedX += moveMouseWithKbX > x ? -1 : 1;
else else
moveMouseWithKbSpeedX = moveMouseWithKbSpeedX * 2 / 3; moveMouseWithKbSpeedX = moveMouseWithKbSpeedX * 2 / 3;
if( abs(moveMouseWithKbY - y) > SDL_ANDROID_sFakeWindowHeight / 5 ) if( abs(moveMouseWithKbY - y) > SDL_ANDROID_sFakeWindowHeight / 12 )
moveMouseWithKbSpeedY += moveMouseWithKbY > y ? -1 : 1; moveMouseWithKbSpeedY += moveMouseWithKbY > y ? -1 : 1;
else else
moveMouseWithKbSpeedY = moveMouseWithKbSpeedY * 2 / 3; moveMouseWithKbSpeedY = moveMouseWithKbSpeedY * 2 / 3;
@@ -529,8 +529,8 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j
moveMouseWithKbX += moveMouseWithKbSpeedX; moveMouseWithKbX += moveMouseWithKbSpeedX;
moveMouseWithKbY += moveMouseWithKbSpeedY; moveMouseWithKbY += moveMouseWithKbSpeedY;
if( abs(moveMouseWithKbX - x) > SDL_ANDROID_sFakeWindowWidth / 4 || if( abs(moveMouseWithKbX - x) > SDL_ANDROID_sFakeWindowWidth / 8 ||
abs(moveMouseWithKbY - y) > SDL_ANDROID_sFakeWindowHeight / 4 ) abs(moveMouseWithKbY - y) > SDL_ANDROID_sFakeWindowHeight / 8 )
{ {
moveMouseWithKbX = -1; moveMouseWithKbX = -1;
moveMouseWithKbY = -1; moveMouseWithKbY = -1;