Change NJInputAnalog so magnitudes of subactions are always positive (e.g. -1 magnitu...
[enjoyable.git] / NJInputHat.m
index b7d0161..409ae07 100644 (file)
@@ -89,8 +89,11 @@ static BOOL active_fourway[20] = {
         size++;
     }
     BOOL *activechildren = (size == 8) ? active_eightway : active_fourway;
-    for (int i = 0; i < 4; i++)
-        [self.children[i] setActive:activechildren[parsed * 4 + i]];
+    for (int i = 0; i < 4; i++) {
+        BOOL active = activechildren[parsed * 4 + i];
+        [self.children[i] setActive:active];
+        [self.children[i] setMagnitude:active];
+    }
 }
 
 @end