Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Util.Rect

Contents

Description

The Rect type.

Synopsis

Documentation

data Rect Source #

Constructors

Rect 

Fields

Instances

Eq Rect # 

Methods

(==) :: Rect -> Rect -> Bool #

(/=) :: Rect -> Rect -> Bool #

Ord Rect # 

Methods

compare :: Rect -> Rect -> Ordering #

(<) :: Rect -> Rect -> Bool #

(<=) :: Rect -> Rect -> Bool #

(>) :: Rect -> Rect -> Bool #

(>=) :: Rect -> Rect -> Bool #

max :: Rect -> Rect -> Rect #

min :: Rect -> Rect -> Rect #

Read Rect # 
Show Rect # 

Methods

showsPrec :: Int -> Rect -> ShowS #

show :: Rect -> String #

showList :: [Rect] -> ShowS #

Pretty.Pretty Rect # 
CStorable Rect #

It should be in Util.Rect, but hscs are annoying to work with, and I think this is where the storable instance is actually used.

access

upper_left :: Rect -> Point Source #

lower_left :: Rect -> Point Source #

upper_right :: Rect -> Point Source #

lower_right :: Rect -> Point Source #

constructor

xywh :: Int -> Int -> Int -> Int -> Rect Source #

transformation

place :: Int -> Int -> Rect -> Rect Source #

resize :: Int -> Int -> Rect -> Rect Source #

functions

distance :: Point -> Rect -> Double Source #

Distance from a point to a rectangle.

intersection :: Rect -> Rect -> Rect Source #

Find the intersection of two rectangles.

touches :: Rect -> Rect -> Bool Source #

This is like overlaps, but is also true if the the rectangle touch each other.

point_distance :: Point -> Point -> Double Source #

touches_point :: Rect -> Point -> Bool Source #

This is like contains_point, but is also true if the the point is on the right or bottom edge of the rectangle.