Skip to content

Commit

Permalink
Fixed Issue #7. Added cases to take into account the curvature of the…
Browse files Browse the repository at this point in the history
… arrow.
  • Loading branch information
Isomorphisme committed May 1, 2018
1 parent 798289c commit 43f0d9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/GridEdge.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ export default class GridEdge extends Component {
this.setState({
labelX: `calc(50% + ${-width / 2 - 6.5}px)`,
labelY: ({
left: bbox.y - height - heightDiff / 2 - 5,
right: bbox.y + bbox.height + heightDiff / 2 + 5,
left: this.props.bend > 0
? bbox.y - height / 2 - heightDiff * 2 - 10
: bbox.y + bbox.height - height / 2 - heightDiff * 2 - 10,
right: this.props.bend > 0
? bbox.y - height / 2 + heightDiff * 2 + 10
: bbox.y + bbox.height - height / 2 + heightDiff * 2 + 10,
inside: this.props.bend > 0
? bbox.y - height / 2
: bbox.y + bbox.height - height / 2
Expand Down

0 comments on commit 43f0d9d

Please sign in to comment.