Skip to content
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

Returned transformation from adjustDia doesn't map (0,0) to any of the diagrams bounding corners #44

Open
ocharles opened this issue Mar 16, 2018 · 1 comment

Comments

@ocharles
Copy link

ocharles commented Mar 16, 2018

See this IRC transcript:

ocharles: Can anyone make any sense of this? https://gist.github.com/ocharles/2c36ebc4eadae5602479ead97cb9917e I'm translating pixel coordinates back into diagram space, but ending up with a flipped y

ocharles: in that paste, see the "traceShowM" lines where I show the bounding box of my diagram, and then apparently map the (0,0) pixel of the rendered diagram to something completely outside that bounding box

ocharles: I see this in the rasterific backend: "adjustDia c opts d = adjustDia2D sizeSpec c opts (d # reflectY)" I wonder if that has something to do with it

ocharles: As a work around, I'm currently flipping the y axis on the result of calls to papply atm and then things do line up correctly

byorgey: ocharles: yeah, it probably has to do with the reflectY in the backend, which is done since many backends have the positive y-axis pointing downwards, but diagrams has it pointing upwards

@byorgey
Copy link
Member

byorgey commented Apr 16, 2018

@ocharles I'm trying to figure out whether this is a bug in diagrams or in your intuition. Do you have reason to believe that the origin should be included in the envelope of the diagram you are rendering?

Also, note that the flipped y is expected: pixel coordinates have the positive y axis pointing downwards, but diagrams coordinates have it pointing upwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants