Safari fixes

This commit is contained in:
Ian Gulliver
2019-07-11 18:14:06 +00:00
parent 2cbaade0d5
commit f3e93176b9
3 changed files with 20 additions and 15 deletions

View File

@@ -8,6 +8,19 @@ class LayoutLink {
this.nodesByPos_ = nodesByPos;
this.linksByPos_ = linksByPos;
this.labelsByPos_ = labelsByPos;
// Mapping to lines.svg clock-style numbering
this.outPointLookup_ = new StringMap([
[[ 0,-1], 0],
[[ 1,-1], 1],
[[ 1, 0], 2],
[[ 1, 1], 3],
[[ 0, 1], 4],
[[-1, 1], 5],
[[-1, 0], 6],
[[-1,-1], 7],
]);
this.bfs();
}
@@ -99,18 +112,6 @@ class LayoutLink {
}
}
// Mapping to lines.svg clock-style numbering
outPointLookup = new StringMap([
[[ 0,-1], 0],
[[ 1,-1], 1],
[[ 1, 0], 2],
[[ 1, 1], 3],
[[ 0, 1], 4],
[[-1, 1], 5],
[[-1, 0], 6],
[[-1,-1], 7],
]);
getCost(from, to) {
// Only handles adjacent positions
@@ -175,7 +176,7 @@ class LayoutLink {
to[0] - from[0],
to[1] - from[1],
];
return this.outPointLookup.get(offset);
return this.outPointLookup_.get(offset);
}
getInPoint(from, to) {