boundsAnchor :: Alignment -> Bounds -> (Rational, Rational)
boundsAnchor al Bounds{..} =
  case al of
    TL -> (boundsL, boundsT)
    BL -> (boundsL, boundsB)
    L  -> (boundsL, 0.5 * (boundsT + boundsB))
    TR -> (boundsR, boundsT)
    BR -> (boundsR, boundsB)
    R  -> (boundsR, 0.5 * (boundsT + boundsB))
    T  -> (0.5 * (boundsL + boundsR), boundsT)
    B  -> (0.5 * (boundsL + boundsR), boundsB)
    C  -> (0.5 * (boundsL + boundsR), 0.5 * (boundsT + boundsB))
boundsAnchor :: Alignment -> Bounds -> (Rational, Rational)
boundsAnchor al Bounds{..} =
  case al of
    TL -> (boundsL, boundsT)
    BL -> (boundsL, boundsB)
    L  -> (boundsL, 0.5 * (boundsT + boundsB))
    TR -> (boundsR, boundsT)
    BR -> (boundsR, boundsB)
    R  -> (boundsR, 0.5 * (boundsT + boundsB))
    T  -> (0.5 * (boundsL + boundsR), boundsT)
    B  -> (0.5 * (boundsL + boundsR), boundsB)
    C  -> (0.5 * (boundsL + boundsR), 0.5 * (boundsT + boundsB))
boundsAnchor al Bounds{..} =
  case al of
    TL -> (boundsL, boundsT)
    BL -> (boundsL, boundsB)
    L  -> (boundsL, 0.5 * (boundsT + boundsB))
    TR -> (boundsR, boundsT)
    BR -> (boundsR, boundsB)
    R  -> (boundsR, 0.5 * (boundsT + boundsB))
    T  -> (0.5 * (boundsL + boundsR), boundsT)
    B  -> (0.5 * (boundsL + boundsR), boundsB)
    C  -> (0.5 * (boundsL + boundsR), 0.5 * (boundsT + boundsB))