From f90dd4ffc4b679e61a2a8cf43853b7d3c72c3e83 Mon Sep 17 00:00:00 2001 From: randomguy3 Date: Tue, 17 Jan 2012 18:39:31 +0000 Subject: Calculate the head and tail of edges to be just where they contact the node (ie: behave more like tikz). git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@388 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64 --- tikzit/src/common/Node.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'tikzit/src/common/Node.m') diff --git a/tikzit/src/common/Node.m b/tikzit/src/common/Node.m index 8880826..136fe20 100644 --- a/tikzit/src/common/Node.m +++ b/tikzit/src/common/Node.m @@ -24,7 +24,6 @@ #import "Node.h" #import "Shape.h" -#import "ShapeNames.h" @implementation Node @@ -48,7 +47,7 @@ if (style) { return [Shape shapeForName:[style shapeName]]; } else { - return [Shape shapeForName:SHAPE_CIRCLE]; + return nil; } } @@ -74,10 +73,13 @@ } - (NSRect) boundsUsingShapeTransform:(Transformer*)shapeTrans { - float strokeThickness = style ? [style strokeThickness] : [NodeStyle defaultStrokeThickness]; - NSRect screenBounds = [shapeTrans rectToScreen:[[self shape] boundingRect]]; - screenBounds = NSInsetRect(screenBounds, -strokeThickness, -strokeThickness); - return screenBounds; + //if (style) { + return [shapeTrans rectToScreen:[[self shape] boundingRect]]; + /*} else { + NSRect r = NSZeroRect; + r.origin = [shapeTrans toScreen:[self point]]; + return r; + }*/ } - (NSRect) boundingRect { -- cgit v1.2.3