Fix bug with mapping tool and library bugfixes
authorMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Wed, 21 Aug 2013 06:45:57 +0000 (23:45 -0700)
committerMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Wed, 21 Aug 2013 06:45:57 +0000 (23:45 -0700)
TestPatterns.pde
code/GLucose.jar
code/HeronLX.jar

index bdaa78ac563b916aacd84974cb4a79c2c4d973c3..e47651af4271f4cdf8618190fb2ac8326e142816 100644 (file)
@@ -256,7 +256,7 @@ class MappingTool extends TestPattern {
     if (activeChannel.mode == ChannelMapping.MODE_CUBES) {
       int i = 1;
       for (int index : activeChannel.objectIndices) {
-        if (c == model.getCubeByRawIndex(index)) {
+        if ((index >= 0) && (c == model.getCubeByRawIndex(index))) {
           return i;
         }
         ++i;
@@ -359,10 +359,7 @@ class MappingTool extends TestPattern {
   }
   
   public void decChannel() {
-    --channelIndex;
-    if (channelIndex < 0) {
-      channelIndex += numChannels;
-    }
+    channelIndex = (channelIndex + numChannels - 1) % numChannels;
     setChannel();    
   }
   
@@ -371,10 +368,7 @@ class MappingTool extends TestPattern {
   }
   
   public void decStrip() {
-    --stripIndex;
-    if (stripIndex < 0) {
-      stripIndex += Cube.STRIPS_PER_CUBE;
-    }
+    stripIndex = (stripIndex + Cube.STRIPS_PER_CUBE - 1) % Cube.STRIPS_PER_CUBE;
   }
   
   public void keyPressed() {
index d8f3c05c0993e311a70bb72bca484d598a6e5337..457c9746ffe51e246ffce68255cf97508e9cc116 100644 (file)
Binary files a/code/GLucose.jar and b/code/GLucose.jar differ
index 608c30c076596b559a19d96b3bde7d980fab3d6c..57713186b387fe4d69bc1b118f2ea2739dc59383 100644 (file)
Binary files a/code/HeronLX.jar and b/code/HeronLX.jar differ