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

space is not left for empty diagram when using e.g. hcat' with {sep = ... } #3

Closed
fryguybob opened this Issue Aug 4, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@fryguybob
Member

fryguybob commented Aug 4, 2012

(Imported from http://code.google.com/p/diagrams/issues/detail?id=32. Original issue from byor...@gmail.com on May 24, 2011, 10:09:35 PM UTC)

I was surprised today to find that

hcat' with {sep = 1} [square, mempty, square]

and

hcat' with {sep = 1} [square, square]

produce the same output. However, the first ought to produce two squares with two units of space between them: one unit between the first square and mempty, and one unit between mempty and the second square.

@fryguybob fryguybob closed this Aug 4, 2012

@fryguybob

This comment has been minimized.

Show comment
Hide comment
@fryguybob

fryguybob Aug 4, 2012

Member

(Imported. Original comment by byor...@gmail.com on June 8, 2011, 06:59:25 PM UTC)

The problem was that cat' worked by (among other things) calling 'align' on some of the intermediate results of the composition, which doesn't work correctly if you have just positioned 'mempty' a certain distance away from another diagram -- composing with 'mempty' doesn't affect the bounds, so the only information we have left about where the next diagram is supposed to go is the position of the local origin. Basically the fix was to carefully orchestrate things so we only ever call 'boundary' and 'align' on single input diagrams to get them set up properly and then during the actual composition we just move local origins around.

Member

fryguybob commented Aug 4, 2012

(Imported. Original comment by byor...@gmail.com on June 8, 2011, 06:59:25 PM UTC)

The problem was that cat' worked by (among other things) calling 'align' on some of the intermediate results of the composition, which doesn't work correctly if you have just positioned 'mempty' a certain distance away from another diagram -- composing with 'mempty' doesn't affect the bounds, so the only information we have left about where the next diagram is supposed to go is the position of the local origin. Basically the fix was to carefully orchestrate things so we only ever call 'boundary' and 'align' on single input diagrams to get them set up properly and then during the actual composition we just move local origins around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment