Browse Source

Tried fixing movement

Thomas Buck 12 years ago
parent
commit
952b07f2fb
1 changed files with 12 additions and 4 deletions
  1. 12
    4
      CubeControl/cubeWorker.java

+ 12
- 4
CubeControl/cubeWorker.java View File

163
     if (dir == UP){
163
     if (dir == UP){
164
         //animation moved up
164
         //animation moved up
165
       if (selectedAnimation > 0) {
165
       if (selectedAnimation > 0) {
166
-        Collections.swap(animations, selectedAnimation, selectedAnimation - 1);
166
+        Animation tmp = animations.get(selectedAnimation);
167
+		animations.set(selectedAnimation, animations.get(selectedAnimation - 1));
168
+		animations.set(selectedAnimation - 1, tmp);
167
     }
169
     }
168
     } else if (dir == DOWN){
170
     } else if (dir == DOWN){
169
       //animation moved down
171
       //animation moved down
170
     if (selectedAnimation < (animations.size() - 1)) {
172
     if (selectedAnimation < (animations.size() - 1)) {
171
-      Collections.swap(animations, selectedAnimation, selectedAnimation + 1);
173
+        Animation tmp = animations.get(selectedAnimation);
174
+		animations.set(selectedAnimation, animations.get(selectedAnimation + 1));
175
+		animations.set(selectedAnimation + 1, tmp);
172
   }
176
   }
173
     }
177
     }
174
   }
178
   }
280
     if (dir == UP){
284
     if (dir == UP){
281
         // frame moved up
285
         // frame moved up
282
         if (frame > 0) {
286
         if (frame > 0) {
283
-          Collections.swap(animations.get(anim).frames, frame, frame - 1);
287
+          AFrame tmp = animations.get(anim).frames.get(frame);
288
+		  animations.get(anim).frames.set(frame, animations.get(anim).frames.get(frame - 1));
289
+		  animations.get(anim).frames.set(frame - 1, tmp);
284
       }
290
       }
285
     } else if (dir == DOWN){
291
     } else if (dir == DOWN){
286
       // frame moved down
292
       // frame moved down
287
     if (frame < (animations.get(anim).size() - 1)) {
293
     if (frame < (animations.get(anim).size() - 1)) {
288
-      Collections.swap(animations.get(anim).frames, frame, frame + 1);
294
+      AFrame tmp = animations.get(anim).frames.get(frame);
295
+		  animations.get(anim).frames.set(frame, animations.get(anim).frames.get(frame + 1));
296
+		  animations.get(anim).frames.set(frame + 1, tmp);
289
     }
297
     }
290
     }
298
     }
291
   }
299
   }

Loading…
Cancel
Save