Skip to content
This repository was archived by the owner on Nov 18, 2019. It is now read-only.

Interaction bars are drawn poorly #6

Open
blakesweeney opened this issue Oct 3, 2012 · 1 comment
Open

Interaction bars are drawn poorly #6

blakesweeney opened this issue Oct 3, 2012 · 1 comment
Labels

Comments

@blakesweeney
Copy link
Owner

The interaction bars are not drawn well. They should start and end near the center of the letter without overlapping the start or end letters. It is ok if the line overlaps other letters however.

blakesweeney added a commit that referenced this issue Oct 4, 2012
This improves the drawing of interactions a great deal, however they are not
perfect. In some cases it's a bit unclear as to where the interaction is going.
I will have to improve it in the future but for now this is good. The method is
as follows.

I'm going to detail my thoughts so I have a chance of figuring out why I did
this a couple months.

We draw a line between the center of the letters. For some reason using height/4
works better to get the vertical center than just height/2. It produces a more
pleasing location.

We then draw a right triangle using the direct line as the hypotenuse. We then
draw a circle of radius ntRadius from the first point. The line that is parallel
the y line that goes through the intersection of the direct line and circle
splits the sides of the triangle. We then use this splitting and a^2+b^2=c^2 to
determine the x and y coordinates of the point to start drawing at. Basically if
we label the direct line d, the radius r and the horizontal distance x we can
find the horizontal distance a by:

d/r = x-a/a

so a is

a = x*r / (d+r);

We then get b by

r^2 = a^2 + b^2

That would be a lot clearer with pictures.
@blakesweeney
Copy link
Owner Author

I'm closing this for now. There is still work to be done with this, but it could be due to the diagrams not being laid out quite right. This could lead to lines that are shifted a bit and thus ugly. But I may need to return to it later.

blakesweeney added a commit that referenced this issue Oct 6, 2012
I've made the interaction lines better. They still need work I think. The
special cases seem pretty good, but the general case draws things that look
crooked. Not quite sure why, or how exactly I want the lines drawn.
@blakesweeney blakesweeney reopened this Oct 6, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant