-
Notifications
You must be signed in to change notification settings - Fork 62
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
Delayed subtrees #137
Delayed subtrees #137
Conversation
The idea is that arrow' can now take the *final* transformation into account so it can properly decide what to draw. See #112. Things seem to be almost working... but it seems we don't quite handle frozen transforms properly yet, since things are flipped in the Y-axis.
…shaft This is another cool thing enabled by doing arrows as delayed leaves: in addition to knowing the overall transformation in effect when drawing an arrow, we know the overall *style*! So we can grab e.g. the line color and use it as a fill color for the arrow head and tail. In particular, this patch sets things up so that line color is used by default for the head, tail, and shaft of an arrow. That is, doing (arrow ... # lc blue) will result in a completely blue arrow (including head and tail). This can be overridden by setting headStyle, tailStyle, or shaftStyle as usual.
Whoops, there's something screwy about the way envelopes are handled, please don't merge yet. |
Hah, it's not the envelopes that are screwy. The envelopes are exactly what they should be. It's the shafts---they are getting flipped somehow (not reversed, but mirrored along the axis of the arrow). No clue why yet. |
Previously, arrow' simply took the tranformation and applied it to the points origin and (len,0), and then drew an arrow between the images of those points. However, the transformation might also be doing some flipping or shearing which was getting ignored: affine transformations are not determined by their action on two points. This was causing, e.g. shafts to be drawn flipped along the axis of the arrow with the SVG backend, since the SVG backend does a `reflectY` as the last thing before freezing, but it was getting ignored. This patch makes `arrow'` properly apply the transformation to the shaft trail prior to uniformly scaling and positioning it.
That ought to do it. As far as I know this (along with diagrams/diagrams-core#47 and diagrams/diagrams-doc#40) are ready for merging. The website builds and all the example diagrams seem correct. |
Depends on diagrams/diagrams-core#47; that should be merged first.
This pull request has two major components: