Skip to content

Instantly share code, notes, and snippets.

@C4Code
Created January 23, 2013 05:05
Show Gist options
  • Save C4Code/4602190 to your computer and use it in GitHub Desktop.
Save C4Code/4602190 to your computer and use it in GitHub Desktop.
Difference between scaling and doubling the size of a bezier path... Scaling actually distorts the size of the shape's border.
@implementation C4WorkSpace {
C4Shape *s, *t;
}
-(void)setup {
s = [C4Shape rect:CGRectMake(20, 20, 100, 100)];
[self.canvas addShape:s];
t = [C4Shape rect:CGRectMake(400, 20, 100, 100)];
[self.canvas addShape:t];
[self runMethod:@"test" afterDelay:1.0f];
}
-(void)test {
s.shapeLayer.affineTransform = CGAffineTransformMakeScale(2, 2);
s.origin = CGPointMake(20,20);
CGRect newFrame = t.frame;
newFrame.size.width *= 2;
newFrame.size.height *= 2;
[t rect:newFrame];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment