Created
January 23, 2013 05:05
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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