Skip to content

Commit

Permalink
bug fix in deformEnvelope
Browse files Browse the repository at this point in the history
Fixes #316.
  • Loading branch information
byorgey committed Jun 11, 2018
1 parent a26bc84 commit d571420
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Diagrams/Combinators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ strut v = QD $ D.leafU (inj . toDeletable $ env)
extrudeEnvelope
:: (Metric v, OrderedField n, Monoid' m)
=> v n -> QDiagram b v n m -> QDiagram b v n m
extrudeEnvelope = deformEnvelope 0.5
extrudeEnvelope = deformEnvelope 1

-- | @intrudeEnvelope v d@ asymmetrically \"intrudes\" the envelope of
-- a diagram away from the given direction. All parts of the envelope
Expand All @@ -157,7 +157,7 @@ extrudeEnvelope = deformEnvelope 0.5
intrudeEnvelope
:: (Metric v, OrderedField n, Monoid' m)
=> v n -> QDiagram b v n m -> QDiagram b v n m
intrudeEnvelope = deformEnvelope (-0.5)
intrudeEnvelope = deformEnvelope (-1)

-- Utility for extrudeEnvelope / intrudeEnvelope
deformEnvelope
Expand All @@ -167,7 +167,7 @@ deformEnvelope s v = over (envelope . _Wrapping Envelope) deformE
where
deformE = Option . fmap deformE' . getOption
deformE' env v'
| dp > 0 = Max $ getMax (env v') + (dp * s) / norm v'
| dp > 0 = Max $ getMax (env v') + (dp * s) / quadrance v'
| otherwise = env v'
where
dp = v' `dot` v
Expand Down

0 comments on commit d571420

Please sign in to comment.