{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
module Diagrams.TwoD.Align
(
alignL, alignR, alignT, alignB
, alignTL, alignTR, alignBL, alignBR
, snugL, snugR, snugT, snugB
, alignX, snugX, alignY, snugY
, centerX, centerY, centerXY
, snugCenterX, snugCenterY, snugCenterXY
) where
import Diagrams.Core
import Diagrams.Align
import Diagrams.TwoD.Types
import Diagrams.TwoD.Vector
alignL :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a
alignL :: a -> a
alignL = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, HasOrigin a) =>
v n -> a -> a
align V2 n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unit_X
snugL :: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a
snugL :: a -> a
snugL = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> a -> a
snug V2 n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unit_X
alignR :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a
alignR :: a -> a
alignR = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, HasOrigin a) =>
v n -> a -> a
align V2 n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unitX
snugR :: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a
snugR :: a -> a
snugR = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> a -> a
snug V2 n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unitX
alignT :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a
alignT :: a -> a
alignT = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, HasOrigin a) =>
v n -> a -> a
align V2 n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unitY
snugT:: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a
snugT :: a -> a
snugT = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> a -> a
snug V2 n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unitY
alignB :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a
alignB :: a -> a
alignB = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, HasOrigin a) =>
v n -> a -> a
align V2 n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unit_Y
snugB :: (InSpace V2 n a, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a
snugB :: a -> a
snugB = V2 n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> a -> a
snug V2 n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unit_Y
alignTL, alignTR, alignBL, alignBR :: (InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) => a -> a
alignTL :: a -> a
alignTL = a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignT (a -> a) -> (a -> a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignL
alignTR :: a -> a
alignTR = a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignT (a -> a) -> (a -> a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignR
alignBL :: a -> a
alignBL = a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignB (a -> a) -> (a -> a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignL
alignBR :: a -> a
alignBR = a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignB (a -> a) -> (a -> a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
forall n a.
(InSpace V2 n a, Fractional n, Alignable a, HasOrigin a) =>
a -> a
alignR
alignX :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) => n -> a -> a
alignX :: n -> a -> a
alignX = v n -> n -> a -> a
forall a (v :: * -> *) n.
(Alignable a, InSpace v n a, Fractional n, HasOrigin a) =>
v n -> n -> a -> a
alignBy v n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unitX
snugX :: (InSpace v n a, R1 v, Fractional n, Alignable a, Traced a, HasOrigin a) => n -> a -> a
snugX :: n -> a -> a
snugX = v n -> n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> n -> a -> a
snugBy v n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unitX
alignY :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => n -> a -> a
alignY :: n -> a -> a
alignY = v n -> n -> a -> a
forall a (v :: * -> *) n.
(Alignable a, InSpace v n a, Fractional n, HasOrigin a) =>
v n -> n -> a -> a
alignBy v n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unitY
snugY :: (InSpace v n a, R2 v, Fractional n, Alignable a, Traced a, HasOrigin a) => n -> a -> a
snugY :: n -> a -> a
snugY = v n -> n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> n -> a -> a
snugBy v n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unitY
centerX :: (InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) => a -> a
centerX :: a -> a
centerX = v n -> n -> a -> a
forall a (v :: * -> *) n.
(Alignable a, InSpace v n a, Fractional n, HasOrigin a) =>
v n -> n -> a -> a
alignBy v n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unitX n
0
snugCenterX :: (InSpace v n a, R1 v, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a
snugCenterX :: a -> a
snugCenterX = v n -> n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> n -> a -> a
snugBy v n
forall (v :: * -> *) n. (R1 v, Additive v, Num n) => v n
unitX n
0
centerY :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => a -> a
centerY :: a -> a
centerY = v n -> n -> a -> a
forall a (v :: * -> *) n.
(Alignable a, InSpace v n a, Fractional n, HasOrigin a) =>
v n -> n -> a -> a
alignBy v n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unitY n
0
snugCenterY :: (InSpace v n a, R2 v, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a
snugCenterY :: a -> a
snugCenterY = v n -> n -> a -> a
forall (v :: * -> *) n a.
(InSpace v n a, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
v n -> n -> a -> a
snugBy v n
forall (v :: * -> *) n. (R2 v, Additive v, Num n) => v n
unitY n
0
centerXY :: (InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) => a -> a
centerXY :: a -> a
centerXY = a -> a
forall (v :: * -> *) n a.
(InSpace v n a, R1 v, Fractional n, Alignable a, HasOrigin a) =>
a -> a
centerX (a -> a) -> (a -> a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
forall (v :: * -> *) n a.
(InSpace v n a, R2 v, Fractional n, Alignable a, HasOrigin a) =>
a -> a
centerY
snugCenterXY :: (InSpace v n a, R2 v, Fractional n, Alignable a, Traced a, HasOrigin a) => a -> a
snugCenterXY :: a -> a
snugCenterXY = a -> a
forall (v :: * -> *) n a.
(InSpace v n a, R1 v, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
a -> a
snugCenterX (a -> a) -> (a -> a) -> a -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> a
forall (v :: * -> *) n a.
(InSpace v n a, R2 v, Fractional n, Alignable a, Traced a,
HasOrigin a) =>
a -> a
snugCenterY