Skip to content

Commit

Permalink
fix logic oversight
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzielenski committed Oct 18, 2014
1 parent 11ee9a4 commit 71f622b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions carFileTool/src/CFTEffectWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,15 @@ - (void)removeEffectAtIndex:(NSUInteger)index {

- (void)moveEffectAtIndex:(NSUInteger)index toIndex:(NSUInteger)destination {
__strong CFTEffect *effect = self.effects[index];

if (index < destination)
destination--;

[self.effects removeObjectAtIndex:index];

if (destination > self.effects.count)
destination = self.effects.count;

[self.effects insertObject:effect atIndex:destination];
}

Expand Down

0 comments on commit 71f622b

Please sign in to comment.