Safe Haskell | Safe-Inferred |
---|
The Rect
type.
Synopsis
- data Rect = Rect Int Int Int Int
- type Point = (Int, Int)
- x :: Rect -> Int
- y :: Rect -> Int
- w :: Rect -> Int
- h :: Rect -> Int
- r :: Rect -> Int
- b :: Rect -> Int
- upper_left :: Rect -> Point
- lower_left :: Rect -> Point
- upper_right :: Rect -> Point
- lower_right :: Rect -> Point
- xywh :: Int -> Int -> Int -> Int -> Rect
- empty :: Rect
- place :: Int -> Int -> Rect -> Rect
- resize :: Int -> Int -> Rect -> Rect
- distance :: Point -> Rect -> Double
- intersection :: Rect -> Rect -> Rect
- overlaps :: Rect -> Rect -> Bool
- touches :: Rect -> Rect -> Bool
- point_distance :: Point -> Point -> Double
- contains_point :: Rect -> Point -> Bool
- touches_point :: Rect -> Point -> Bool
Documentation
access
upper_left :: Rect -> Point Source #
lower_left :: Rect -> Point Source #
upper_right :: Rect -> Point Source #
lower_right :: Rect -> Point Source #
constructor
transformation
functions
touches :: Rect -> Rect -> Bool Source #
This is like overlaps
, but is also true if the the rectangle touch each
other.
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.