-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
presence of arrowHead can tilt connection sideways #162
Comments
This is another motivating example for having an arrow-drawing mode which takes an appropriate section of the shaft rather than scaling and rotating the shaft to fit between the gaps and arrowhead. Of course in the general case this is more problematic (it may not even be possible to find an appropriate shaft section in all cases, there may be very bad interaction between shaft direction and arrowhead direction, etc.), but I hope we can come up with something that works well for "sufficiently nice" cases. |
For relevant IRC discussion see http://ircbrowse.net/browse/diagrams?id=16233×tamp=1393701010#t1393701010 |
I am thinking that we might want different POLICIES for drawing connections. there is the current policy where the path can be both rotated an scaled. we could have an additional policy that does not allow rotation, but allows both scaling of the whole path and adjusting of the lengths of the 2 end legs. |
Well, even with the second policy we have to allow rotation, e.g. what happens if you specify that |
this is why I proposed that the end legs could be independently adjusted. this way you can easily get the end points on the line joining the two desired end points of the connection; then scaling of the whole path can get you to actually overlap the points. |
After sleeping over it, I had some ideas; so here is a brain dump, lest I forget. "connect" was designed for relatively simple arrows, and, for that usage, its policy of auto scaling/rotating is excellent. let's not fix what's not broken. however, there are many types of technical diagrams that require complex connections with layout requirements not compatible with auto scaling/rotations. this is a different usage and it should be provided through a different api. my first thought was that I would be happy with a simple way to express zigzag connections, i.e. connections made out of alternatingly horizontal/vertical straight-line segments:
zigzagX indicates that the first leg (out of N1) should start horizontally, L is a list of Double providing signed magnitudes of displacement for all legs except the last 2. the last 2 are automatically provided and adjusted to reach N2. my second thought was that zigzag could be obtained as a specialization of a more general:
where T is a trail which is automatically translated so that its initial point coincides with N1, then the trail is automatically extended, according to policy P, to reach N2. example of policies:
to be completely general, we could make the policy be a class with a method "finish" that takes a trail and a diagram, and returns the trail extended to reach the diagram. that way, we can vary both the types of extension-segments, but also whether to reach the origin or the border. maybe, for full generality, there should also be a "start" policy that takes N1 and gives us back the actual point from which to start. |
A few quick toughts:
|
How much of this would be addressed if |
Isn't this what we do currently? Anyway it doesn't help with 1) for example and we need 1) to handle 4). Sometimes the user will just want the semantics of the arrowhead and tail displacing part of the shaft vs scaling the shaft to make room for the head and tail. 3) is what I did in the latest commit of the tail branch. |
I seem to have misunderstood the issue; it's much clearer now that the pastebin is back up. |
Yes, the picture makes things clear. I added an example to the arrows tutorial that shows how the |
I'm closing this issue because it is partly handled by the change from |
see http://paste.hskll.org/get/1129
byorgey suggested a workaround: http://paste.hskll.org/get/1131
but one can see the thick line comming out of the end of the arrowHead
the problem can also not be fixed by shortening the arrow leg of the shaft because since the shaft is scaled automatically, we can't know in advance by how much to shorten.
The text was updated successfully, but these errors were encountered: