mirror of
https://github.com/rgleichman/glance.git
synced 2024-10-26 16:51:29 +03:00
Use a variable for the set of rotation angles.
This commit is contained in:
parent
4ab6c09cf4
commit
b6171533c5
@ -241,7 +241,10 @@ bestAngleForIcon :: (SpecialNum n, ING.Graph gr) =>
|
||||
-> Bool
|
||||
-> (Angle n, n)
|
||||
bestAngleForIcon positionMap graph key@(NodeName nodeId, _) reflected =
|
||||
minimumBy (compare `on` snd) $ (\angle -> (angle, scoreAngle iconPosition edges reflected angle)) <$> fmap (@@ turn) [0,(1/24)..1] where
|
||||
minimumBy (compare `on` snd) $ (\angle -> (angle, scoreAngle iconPosition edges reflected angle)) <$> fmap (@@ turn) possibleAngles
|
||||
where
|
||||
possibleAngles = [0,(1/24)..1]
|
||||
-- possibleAngles = [0, 1/2] -- (uncomment this line and comment out the line above to disable rotation)
|
||||
iconPosition = positionMap Map.! key
|
||||
edges = getPositionAndAngles <$> fmap getSucEdge (ING.lsuc graph nodeId) <> fmap getPreEdge (ING.lpre graph nodeId)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE NoMonomorphismRestriction, FlexibleContexts, TypeFamilies, TupleSections #-}
|
||||
{-# LANGUAGE NoMonomorphismRestriction, TupleSections #-}
|
||||
module Translate(
|
||||
translateStringToSyntaxGraph,
|
||||
translateStringToCollapsedGraphAndDecl,
|
||||
|
Loading…
Reference in New Issue
Block a user