module Graphics.Rendering.Rect(Rect(..), Rects(..), shrink, shrink1, renderRects,
RectStyle(..), colour, Backgrounds(..)) where
import Graphics.Rendering.Rect.CSS
import Graphics.Rendering.Rect.Backgrounds
import Graphics.Rendering.Rect.Types
import Linear (M44)
import Control.Monad.IO.Class (MonadIO)
shrink :: Rect -> Float -> Float -> Float -> Float -> Rect
shrink self dLeft dTop dRight dBottom =
Rect (left self + dLeft) (top self + dTop)
(right self - dRight) (bottom self - dBottom)
shrink1 :: Rect -> Float -> Rect
shrink1 self d = shrink self d d d d
renderRects :: (MonadIO m, MonadIO n) =>
n (RectStyle -> Rects -> M44 Float -> m ())
renderRects = do
bg <- renderBackgrounds
return $ \style rects mat -> do
bg (backgrounds style) rects mat