Skip to content

Instantly share code, notes, and snippets.

@C4Tutorials
Last active December 16, 2015 00:49
Show Gist options
  • Save C4Tutorials/5350254 to your computer and use it in GitHub Desktop.
Save C4Tutorials/5350254 to your computer and use it in GitHub Desktop.
Highlighting the center and origin of a square.
//
// C4WorkSpace.m
//
// Created by Travis Kirton and Greg Debicki.
//
#import "C4WorkSpace.h"
@implementation C4WorkSpace
-(void)setup {
C4Shape *square = [C4Shape rect:CGRectMake(0,0,192,192)];
square.center = self.canvas.center;
[self.canvas addShape:square];
C4Shape *c1, *c2;
c1 = [C4Shape ellipse:CGRectMake(0, 0, 20, 20)];
c1.strokeColor = C4RED;
c1.fillColor = [UIColor clearColor];
c2 = [c1 copy];
c1.center = square.origin;
c2.center = square.center;
[self.canvas addObjects:@[square,c1,c2]];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment