Skip to content

Commit

Permalink
Merge pull request #10 from kndl/master
Browse files Browse the repository at this point in the history
Fix implementation of resample in glyph utilities.
  • Loading branch information
britg committed Feb 2, 2017
2 parents a811bf6 + 069b82d commit 31686b5
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions WTMGlyph/WTMGlyphUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
newPoint = CGPointMake(x, y);
newVal = [NSValue valueWithCGPoint:newPoint];
[newPoints addObject:newVal];
workingPoints = Splice(workingPoints, newVal, i);
[workingPoints insertObject:newVal atIndex:i+1];
D = 0.0;
} else {
D += d;
Expand Down Expand Up @@ -107,18 +107,6 @@ CGRect BoundingBox(NSArray *points) {
return CGRectMake(minX, minY, (maxX-minX), (maxY-minY));
}

NSMutableArray* Splice(NSMutableArray *original, id newVal, NSUInteger i) {
NSArray *frontSlice = [original subarrayWithRange:NSMakeRange(0, i)];
NSUInteger len = original.count-i;
NSArray *backSlice = [original subarrayWithRange:NSMakeRange(i, len)];

NSMutableArray *spliced = [NSMutableArray arrayWithArray:frontSlice];
[spliced addObject:newVal];
[spliced addObjectsFromArray:backSlice];

return spliced;
}

float PathLength(NSArray *points) {
float d = 0.0;
NSValue *v1;
Expand Down

0 comments on commit 31686b5

Please sign in to comment.