Skip to content

Commit

Permalink
Merge pull request #158 from diagrams/issue155
Browse files Browse the repository at this point in the history
Exclude extra segment when joining loops in offset. Fixes #155.
  • Loading branch information
fryguybob committed Feb 13, 2014
2 parents dd1c30e + cdd6142 commit ce764d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Diagrams/TwoD/Offset.hs
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ joinSegments _ _ _ _ _ [] = mempty `at` origin
joinSegments _ _ _ _ [] _ = mempty `at` origin
joinSegments j isLoop ml r es ts@(t:_) = t'
where
t' | isLoop = mapLoc (glueTrail . (<> mconcat (take (length ts) $ ss es (ts ++ [t])))) t
t' | isLoop = mapLoc (glueTrail . (<> mconcat (take (length ts * 2 - 1) $ ss es (ts ++ [t])))) t
| otherwise = mapLoc (<> mconcat (ss es ts)) t
ss es' ts' = [j ml r e a b <> unLoc b | (e,(a,b)) <- zip es' . (zip <*> tail) $ ts']
ss es' ts' = concat [[j ml r e a b, unLoc b] | (e,(a,b)) <- zip es' . (zip <*> tail) $ ts']

-- | Take a join style and give the join function to be used by joinSegments.
fromLineJoin
Expand Down

0 comments on commit ce764d0

Please sign in to comment.