From fdcdc923ecac299f0d236b92877bde6c8eb1a576 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Wed, 13 Nov 2013 13:46:36 -0500 Subject: [PATCH] D.TwoD.Arrow: simplify definition of arrowBetween' --- src/Diagrams/TwoD/Arrow.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Diagrams/TwoD/Arrow.hs b/src/Diagrams/TwoD/Arrow.hs index 3de70512..8d1b81ea 100644 --- a/src/Diagrams/TwoD/Arrow.hs +++ b/src/Diagrams/TwoD/Arrow.hs @@ -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.