diff --git a/src/Diagrams/TwoD/Path.hs b/src/Diagrams/TwoD/Path.hs index 99cecd88..784cfac7 100644 --- a/src/Diagrams/TwoD/Path.hs +++ b/src/Diagrams/TwoD/Path.hs @@ -160,7 +160,7 @@ data StrokeOpts a instance Default (StrokeOpts a) where def = StrokeOpts { vertexNames = [] - , queryFillRule = Winding + , queryFillRule = def } -- | A composition of 'stroke' and 'pathFromTrail' for conveniently @@ -221,16 +221,22 @@ data FillRule = Winding -- ^ Interior points are those with a nonzero -- direction crosses the path an odd number -- of times. See -- . - deriving (Eq) + deriving (Eq, Show) + +instance Default FillRule where + def = Winding runFillRule :: FillRule -> P2 -> Path R2 -> Bool runFillRule Winding = isInsideWinding runFillRule EvenOdd = isInsideEvenOdd newtype FillRuleA = FillRuleA (Last FillRule) - deriving (Typeable, Semigroup) + deriving (Typeable, Semigroup, Show) instance AttributeClass FillRuleA +instance Default FillRuleA where + def = FillRuleA $ Last $ def + -- | Extract the fill rule from a 'FillRuleA' attribute. getFillRule :: FillRuleA -> FillRule getFillRule (FillRuleA (Last r)) = r