summaryrefslogtreecommitdiff
path: root/tikzit/src/common/Graph.m
diff options
context:
space:
mode:
authorAlex Merry <dev@randomguy3.me.uk>2013-08-22 17:19:40 +0100
committerAlex Merry <dev@randomguy3.me.uk>2013-08-22 17:19:40 +0100
commit093e7a12524a3ddedd833df6c284025f1d0a4a8c (patch)
tree1861edb0d6e36fa34db351d5e0874d314af362a4 /tikzit/src/common/Graph.m
parent8684196a31707a9fb5e7091ce26ae26f2aa16082 (diff)
Unset default "center" anchor when applying a style
Edges almost always want to be anchored to the "center" of an unstyled (style=none) node, as otherwise edges won't join up. However, this anchor should be discarded if a style is then set on the node, otherwise arrowheads tend to disappear.
Diffstat (limited to 'tikzit/src/common/Graph.m')
-rw-r--r--tikzit/src/common/Graph.m8
1 files changed, 2 insertions, 6 deletions
diff --git a/tikzit/src/common/Graph.m b/tikzit/src/common/Graph.m
index 2a01bae..33a81f6 100644
--- a/tikzit/src/common/Graph.m
+++ b/tikzit/src/common/Graph.m
@@ -736,17 +736,13 @@
NSString *srcAnchor;
NSString *tgtAnchor;
- if ([[e source] style] == nil) {
- srcAnchor = @".center";
- } else if ([[e sourceAnchor] isEqual:@""]) {
+ if ([[e sourceAnchor] isEqual:@""]) {
srcAnchor = @"";
} else {
srcAnchor = [NSString stringWithFormat:@".%@", [e sourceAnchor]];
}
- if ([[e target] style] == nil) {
- tgtAnchor = @".center";
- } else if ([[e targetAnchor] isEqual:@""]) {
+ if ([[e targetAnchor] isEqual:@""]) {
tgtAnchor = @"";
} else {
tgtAnchor = [NSString stringWithFormat:@".%@", [e targetAnchor]];