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

Dark line between diagrams at certain widths #39

Open
JakeBr opened this issue Jan 18, 2014 · 2 comments
Open

Dark line between diagrams at certain widths #39

JakeBr opened this issue Jan 18, 2014 · 2 comments

Comments

@JakeBr
Copy link

JakeBr commented Jan 18, 2014

import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine

main :: IO ()
main = defaultMain dia

dia :: Diagram B R2
dia = (s1 ||| s1) <> s2
  where s1 = square 1 # lw 0 # fc white
        s2 = square 2 # lw 0 # fc crimson

Looks fine with width 100:

test100

But there is a dark line between the squares with width 99:

test2

Tested on Ubuntu 13.04, Cairo 1.12.14

@JakeBr
Copy link
Author

JakeBr commented Jan 18, 2014

Oh, I just noticed that the exact same thing happens with the SVG backend as well.

@fryguybob
Copy link
Member

It could be that this is just an artifact of filling areas that do not align with pixels. Some backends might be able to support aligning to the nearest pixel for some drawing actions. It could also be that if we were more careful about some rounding we would avoid it, but I doubt that that would always be able to help. I don't know of a good way to express aligning to pixels :(.

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

No branches or pull requests

3 participants