|
@@ -163,12 +163,16 @@ public class cubeWorker {
|
163
|
163
|
if (dir == UP){
|
164
|
164
|
//animation moved up
|
165
|
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
|
170
|
} else if (dir == DOWN){
|
169
|
171
|
//animation moved down
|
170
|
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,12 +284,16 @@ public class cubeWorker {
|
280
|
284
|
if (dir == UP){
|
281
|
285
|
// frame moved up
|
282
|
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
|
291
|
} else if (dir == DOWN){
|
286
|
292
|
// frame moved down
|
287
|
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
|
}
|