From e363a25246d76f8e1b1c6f14c0700dedb96c82e9 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Thu, 24 May 2012 12:39:49 +0100 Subject: Do not adjust the height of RegularPolyShape It might look more natural like that, but it's not how TikZ does it. --- tikzit/src/common/RegularPolyShape.m | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tikzit/src/common/RegularPolyShape.m b/tikzit/src/common/RegularPolyShape.m index b500377..b9acdf3 100644 --- a/tikzit/src/common/RegularPolyShape.m +++ b/tikzit/src/common/RegularPolyShape.m @@ -42,24 +42,16 @@ float dtheta = (M_PI * 2.0f) / ((float)sides); float theta = (dtheta/2.0f) - (M_PI / 2.0f); theta += degreesToRadians(rotation); - float maxY=0.0f, minY=0.0f; - NSPoint p; for (int i = 0; i < sides; ++i) { + NSPoint p; p.x = radius * cos(theta); p.y = radius * sin(theta); - if (p.ymaxY) maxY = p.y; [nodes addObject:[Node nodeWithPoint:p]]; theta += dtheta; } - float dy = (minY + maxY) / 2.0f; - for (int i = 0; i < sides; ++i) { - p = [[nodes objectAtIndex:i] point]; - p.y -= dy; - [[nodes objectAtIndex:i] setPoint:p]; [edges addObject:[Edge edgeWithSource:[nodes objectAtIndex:i] andTarget:[nodes objectAtIndex:(i+1)%sides]]]; } -- cgit v1.2.3