bugfix [#24347] Fly mode: Immediately after pressing Shift+F, keys W and S work,...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 21 Oct 2010 09:02:21 +0000 (09:02 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 21 Oct 2010 09:02:21 +0000 (09:02 +0000)
source/blender/editors/space_view3d/view3d_view.c

index 8b3d99e355d27bce359f008f05d1efe73eece10a..15e04f31f2f8f06b967f8c1a2ae307839f9ac627 100644 (file)
@@ -2282,30 +2282,32 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
                                /* impliment WASD keys */
                        case FLY_MODAL_DIR_FORWARD:
                                if (fly->speed < 0.0f) fly->speed= -fly->speed; /* flip speed rather then stopping, game like motion */
-                               else fly->speed += fly->grid; /* increse like mousewheel if were already moving in that difection*/
+                               else if (fly->axis==2) fly->speed += fly->grid; /* increse like mousewheel if were already moving in that difection*/
                                fly->axis= 2;
                                break;
                        case FLY_MODAL_DIR_BACKWARD:
-                               if (fly->speed>0) fly->speed= -fly->speed;
-                               else fly->speed -= fly->grid;
+                               if (fly->speed > 0.0f) fly->speed= -fly->speed;
+                               else if (fly->axis==2) fly->speed -= fly->grid;
                                fly->axis= 2;
                                break;
                        case FLY_MODAL_DIR_LEFT:
                                if (fly->speed < 0.0f) fly->speed= -fly->speed;
+                               else if (fly->axis==0) fly->speed += fly->grid;
                                fly->axis= 0;
                                break;
                        case FLY_MODAL_DIR_RIGHT:
                                if (fly->speed > 0.0f) fly->speed= -fly->speed;
+                               else if (fly->axis==0) fly->speed -= fly->grid;
                                fly->axis= 0;
                                break;
-
-                       case FLY_MODAL_DIR_UP:
-                               if (fly->speed > 0.0f) fly->speed= -fly->speed;
-                               fly->axis= 1;
-                               break;
-
                        case FLY_MODAL_DIR_DOWN:
                                if (fly->speed < 0.0f) fly->speed= -fly->speed;
+                               else if (fly->axis==1) fly->speed += fly->grid;
+                               fly->axis= 1;
+                               break;
+                       case FLY_MODAL_DIR_UP:
+                               if (fly->speed > 0.0f) fly->speed= -fly->speed;
+                               else if (fly->axis==1) fly->speed -= fly->grid;
                                fly->axis= 1;
                                break;