From abff5968359e983088a313158c186f5e4d4595a3 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Tue, 14 Jan 2014 16:49:25 -0500 Subject: [PATCH] bug fix: (1/2 @@ turn) instead of 1/2 --- src/Diagrams/TwoD/Arrowheads.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Diagrams/TwoD/Arrowheads.hs b/src/Diagrams/TwoD/Arrowheads.hs index af736fb8..28157e12 100644 --- a/src/Diagrams/TwoD/Arrowheads.hs +++ b/src/Diagrams/TwoD/Arrowheads.hs @@ -56,8 +56,8 @@ module Diagrams.TwoD.Arrowheads ) where import Control.Lens (from, (&), (.~), (^.)) -import Data.Default.Class import Data.AffineSpace +import Data.Default.Class import Data.Functor ((<$>)) import Data.Maybe (fromMaybe) import Data.Monoid (mempty, (<>)) @@ -120,10 +120,12 @@ arrowheadDart theta = aHead where aHead size shaftWidth = (dartP # moveOriginTo (dartVertices !! 2), joint) where - a = theta r = htRadius * size - dartP = polygon (def & polyType .~ PolyPolar [a, 1/2 - a, 1/2 - a] - [r, r, 0.1 * size, r] & polyOrient .~ NoOrient) + dartP = polygon + ( def & polyType .~ PolyPolar [theta, (1/2 @@ turn) - theta, (1/2 @@ turn) - theta] + [r, r, 0.1 * size, r] + & polyOrient .~ NoOrient + ) dartVertices = (concat . pathVertices) $ dartP m = magnitude (dartVertices !! 1 .-. dartVertices !! 3) s = 1 - shaftWidth / m