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

Broken offset joins with non-vertices in loops #263

Closed
robx opened this issue Sep 29, 2015 · 4 comments
Closed

Broken offset joins with non-vertices in loops #263

robx opened this issue Sep 29, 2015 · 4 comments

Comments

@robx
Copy link
Contributor

robx commented Sep 29, 2015

I get broken offset paths when drawing a rectangle that has more points than just the four corners.

This happens with diagrams 1.3.0.3, it used to work with diagrams 1.2.

dia :: Diagram B
dia = (stroke p # lc blue)
    <> (stroke (offsetPath (-0.1 :: Double) p) # lc red)
    <> (stroke (offsetPath (0.1  :: Double) p) # lc green)
  where
    p :: Path V2 Double
    p = pathFromTrail . wrapTrail . glueLine . lineFromVertices . map p2 $
--          [(0,0), (2,0), (2,1), (2,2), (0,2), (0,0)] -- broken
            [(0,0), (2,0), (2,2), (0,2), (0,0)] -- fine

broken
fine

@byorgey
Copy link
Member

byorgey commented Sep 29, 2015

@fryguybob can you take a look?

@fryguybob
Copy link
Member

My guess is that the straight joint leads to a zero length segment that gets removed, but throws off the rest of the stitching together. I'll take a look soon.

@robx
Copy link
Contributor Author

robx commented Feb 14, 2016

Just wondering, is there any chance of a bugfix release which includes this fix?

@bergey
Copy link
Member

bergey commented Feb 14, 2016

@robx If you can backport the change to the release branch, test that it works, and make a PR, I will push it to Hackage.

robx added a commit to robx/diagrams-lib that referenced this issue Feb 14, 2016
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

4 participants