-
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
diagrams with empty envelopes are not properly separated by struts #115
Comments
Using Cut to accumulate repeated seperations, as discussed in #37, doesn't help here. In vcat, sep is 0, so it doesn't matter what we do with sep. As another example, vcat' with {sep = 0.1} [label 0.08 "FIRST LINE", label 0.08 "SECOND LINE"] produces two non-overlapping lines, as expected. The issue here seems to be in how juxtaposeDefault :: (Enveloped a, HasOrigin a) => V a -> a -> a -> a
juxtaposeDefault v a1 a2 =
case (mv1, mv2) of
(Just v1, Just v2) -> moveOriginBy (v1 ^+^ v2) a2
(Nothing, Just v2) -> moveOriginBy v2 a2
(Just v1, Nothing) -> moveOriginBy v1 a2
_ -> a2
where mv1 = negateV <$> envelopeVMay v a1
mv2 = envelopeVMay (negateV v) a2 This makes |
OK, I had an hour to think about this on my flight yesterday, and I think I now have a good understanding of what is going on and a good story for moving forward. First, the reason the behavior changed between 0.6 and 0.7 is diagrams/diagrams-core@0a457da4. We made @bergey is right that this is unrelated to #37. The problem is really diagrams which have an empty envelope but not an empty appearance: juxtaposing them is very counterintuitive. The right solution, I think, is to give text primitives a point envelope instead of an empty envelope, as suggested in #116. Then they will combine as expected. This makes sense: although text objects take up no space they do have a concrete location. In fact, @bergey's suggested change to |
A cut down example based on code from
av
in#diagrams
:produces
![issue115](https://camo.githubusercontent.com/945ab86392561474f61206789d90d7c318a7b045ee8059e666e64b33be6944a7/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f3533333835392f313137333737302f32383834333263652d323133642d313165332d396131342d3532343530633537653364392e706e67)
(see also http://paste.hskll.org/get/374 and http://paste.hskll.org/get/375).
This may be related to #37 (in fact it's possible that fixing #37 would also fix this; I am not sure).
More generally, we ought to work out and write down a coherent semantics for empty envelopes, juxtaposition, struts, and
cat'
/sep
.The text was updated successfully, but these errors were encountered: