summaryrefslogtreecommitdiff
path: root/tikzit/src/common/RectangleShape.m
diff options
context:
space:
mode:
Diffstat (limited to 'tikzit/src/common/RectangleShape.m')
-rw-r--r--tikzit/src/common/RectangleShape.m41
1 files changed, 21 insertions, 20 deletions
diff --git a/tikzit/src/common/RectangleShape.m b/tikzit/src/common/RectangleShape.m
index e332d40..db9c803 100644
--- a/tikzit/src/common/RectangleShape.m
+++ b/tikzit/src/common/RectangleShape.m
@@ -28,26 +28,27 @@
@implementation RectangleShape
- (id)init {
- [super init];
- Node *n0,*n1,*n2,*n3;
- float sz = 0.2f;
-
- n0 = [Node nodeWithPoint:NSMakePoint(-sz, sz)];
- n1 = [Node nodeWithPoint:NSMakePoint( sz, sz)];
- n2 = [Node nodeWithPoint:NSMakePoint( sz,-sz)];
- n3 = [Node nodeWithPoint:NSMakePoint(-sz,-sz)];
-
- Edge *e0,*e1,*e2,*e3;
-
- e0 = [Edge edgeWithSource:n0 andTarget:n1];
- e1 = [Edge edgeWithSource:n1 andTarget:n2];
- e2 = [Edge edgeWithSource:n2 andTarget:n3];
- e3 = [Edge edgeWithSource:n3 andTarget:n0];
-
- paths = [[NSSet alloc] initWithObjects:[NSArray arrayWithObjects:e0,e1,e2,e3,nil],nil];
-
- styleTikz = @"rectangle";
-
+ self = [super init];
+ if (self) {
+ Node *n0,*n1,*n2,*n3;
+ float sz = 0.2f;
+
+ n0 = [Node nodeWithPoint:NSMakePoint(-sz, sz)];
+ n1 = [Node nodeWithPoint:NSMakePoint( sz, sz)];
+ n2 = [Node nodeWithPoint:NSMakePoint( sz,-sz)];
+ n3 = [Node nodeWithPoint:NSMakePoint(-sz,-sz)];
+
+ Edge *e0,*e1,*e2,*e3;
+
+ e0 = [Edge edgeWithSource:n0 andTarget:n1];
+ e1 = [Edge edgeWithSource:n1 andTarget:n2];
+ e2 = [Edge edgeWithSource:n2 andTarget:n3];
+ e3 = [Edge edgeWithSource:n3 andTarget:n0];
+
+ paths = [[NSSet alloc] initWithObjects:[NSArray arrayWithObjects:e0,e1,e2,e3,nil],nil];
+
+ styleTikz = @"rectangle";
+ }
return self;
}