Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

Util.Rect

Contents

Description

The Rect type.

Synopsis

Documentation

data Rect Source #

Constructors

Rect Int Int Int Int 
Instances
Eq Rect # 
Instance details

Defined in Util.Rect

Methods

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

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

Ord Rect # 
Instance details

Defined in Util.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 # 
Instance details

Defined in Util.Rect

Show Rect # 
Instance details

Defined in Util.Rect

Methods

showsPrec :: Int -> Rect -> ShowS #

show :: Rect -> String #

showList :: [Rect] -> ShowS #

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.

Instance details

Defined in Util.Rect

Methods

sizeOf :: Rect -> Int #

alignment :: Rect -> Int #

peekElemOff :: Ptr Rect -> Int -> IO Rect #

pokeElemOff :: Ptr Rect -> Int -> Rect -> IO () #

peekByteOff :: Ptr b -> Int -> IO Rect #

pokeByteOff :: Ptr b -> Int -> Rect -> IO () #

peek :: Ptr Rect -> IO Rect #

poke :: Ptr Rect -> Rect -> IO () #

Pretty.Pretty Rect # 
Instance details

Defined in Util.Rect

Serialize Rect # 
Instance details

Defined in Cmd.Serialize

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.