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

Delayed subtrees #137

Merged
merged 9 commits into from
Nov 14, 2013
Prev Previous commit
Next Next commit
D.TwoD.Arrow: simplify definition of arrowBetween'
  • Loading branch information
Brent Yorgey committed Nov 13, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit fdcdc923ecac299f0d236b92877bde6c8eb1a576
8 changes: 2 additions & 6 deletions src/Diagrams/TwoD/Arrow.hs
Original file line number Diff line number Diff line change
@@ -332,7 +332,7 @@ arrow' opts len = dArrow # rotateBy (- dir)
-- | @arrowBetween s e@ creates an arrow pointing from @s@ to @e@
-- with default parameters.
arrowBetween :: Renderable (Path R2) b => P2 -> P2 -> Diagram b R2
arrowBetween s e = arrowBetween' def s e
arrowBetween = arrowBetween' def

-- | @arrowBetween' opts s e@ creates an arrow pointing from @s@ to
-- @e@ using the given options. In particular, it scales and
@@ -341,11 +341,7 @@ arrowBetween s e = arrowBetween' def s e
arrowBetween'
:: Renderable (Path R2) b =>
ArrowOpts -> P2 -> P2 -> Diagram b R2
arrowBetween' opts s e = arrow' opts len # rotateBy dir # moveTo s
where
v = e .-. s
len = magnitude v
dir = direction v
arrowBetween' opts s e = arrowAt' opts s (e .-. s)

-- | Create an arrow starting at s with length and direction determined by
-- the vectore v.