From 35576e354e0f103ec3d9d5850600a4cfe41aee78 Mon Sep 17 00:00:00 2001 From: jeffrey rosenbluth Date: Sat, 29 Mar 2014 11:11:10 -0400 Subject: [PATCH] refactor delayedLeaf --- src/Diagrams/TwoD/Arrow.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Diagrams/TwoD/Arrow.hs b/src/Diagrams/TwoD/Arrow.hs index de7dfc83..a5acbfc3 100644 --- a/src/Diagrams/TwoD/Arrow.hs +++ b/src/Diagrams/TwoD/Arrow.hs @@ -447,12 +447,12 @@ arrow' opts len = mkQD' (DelayedLeaf delayedArrow) -- between which we need to draw the shaft do not transform -- uniformly as the transformation applied to the entire arrow. -- See https://github.com/diagrams/diagrams-lib/issues/112. - delayedArrow da = + delayedArrow da g n = let (trans, globalSty) = option mempty untangle . fst $ da - in dArrow globalSty trans len + in dArrow globalSty trans len g n -- Build an arrow and set its endpoints to the image under tr of origin and (len,0). - dArrow sty tr ln = (h' <> t' <> shaft) + dArrow sty tr ln gToO nToO = (h' <> t' <> shaft) # moveOriginBy (tWidth *^ (unit_X # rotate tAngle)) # rotate (direction (q .-. p) ^-^ dir) # moveTo p @@ -475,14 +475,14 @@ arrow' opts len = mkQD' (DelayedLeaf delayedArrow) hSize = case fromMaybe (Output 20) (getHeadSize <$> getAttr sty) of Output x -> x Local x -> x - Normalized x -> x - Global x -> x + Normalized x -> nToO * x + Global x -> gToO * x tSize = case fromMaybe (Output 20) (getTailSize <$> getAttr sty) of Output x -> x Local x -> x - Normalized x -> x - Global x -> x + Normalized x -> nToO * x + Global x -> gToO * x -- Make the head and tail and save their widths. (h, hWidth') = mkHead hSize opts'