Skip to content

Commit

Permalink
correct fill loops`
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyrosenbluth committed Nov 27, 2013
1 parent 12fef1e commit e182745
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Diagrams/TwoD/Path.hs
Expand Up @@ -56,6 +56,8 @@ import Data.AffineSpace
import Data.Default.Class
import Data.VectorSpace

import Data.Colour (transparent)

import Diagrams.Coordinates
import Diagrams.Core
import Diagrams.Located (Located, mapLoc, unLoc)
Expand All @@ -65,6 +67,7 @@ import Diagrams.Segment
import Diagrams.Solve
import Diagrams.Trail
import Diagrams.TrailLike
import Diagrams.Attributes (fcA)
import Diagrams.TwoD.Segment ()
import Diagrams.TwoD.Types
import Diagrams.Util (tau)
Expand Down Expand Up @@ -171,9 +174,9 @@ instance Renderable (Path R2) b => TrailLike (QDiagram b R2 Any) where
-- ... }@ syntax may be used.
stroke' :: (Renderable (Path R2) b, IsName a) => StrokeOpts a -> Path R2 -> Diagram b R2
stroke' opts path
| null (pLines ^. unwrapped) = mkP pLoops
| null (pLoops ^. unwrapped) = mkP pLines
| otherwise = mkP pLines <> mkP pLoops
| null (pLines ^. unwrapped) = mkP pLoops
| null (pLoops ^. unwrapped) = fcA transparent $ mkP pLines
| otherwise = (fcA transparent $ mkP pLines) <> mkP pLoops
where
(pLines,pLoops) = partitionPath (isLine . unLoc) path
mkP p
Expand Down

0 comments on commit e182745

Please sign in to comment.