Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Util.Rect

Description

The Rect type.

Synopsis

Documentation

data Rect Source #

Constructors

Rect Int Int Int Int 

Instances

Instances details
Read Rect Source # 
Instance details

Defined in Util.Rect

Show Rect Source # 
Instance details

Defined in Util.Rect

Methods

showsPrec :: Int -> Rect -> ShowS #

show :: Rect -> String #

showList :: [Rect] -> ShowS #

CStorable Rect Source # 
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 () #

Eq Rect Source # 
Instance details

Defined in Util.Rect

Methods

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

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

Ord Rect Source # 
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 #

Pretty.Pretty Rect Source # 
Instance details

Defined in Util.Rect

Serialize Rect Source # 
Instance details

Defined in Cmd.Serialize

type Point = (Int, Int) Source #

access

x :: Rect -> Int Source #

y :: Rect -> Int Source #

w :: Rect -> Int Source #

h :: Rect -> Int Source #

r :: Rect -> Int Source #

b :: Rect -> Int 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.

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.

Orphan instances

CStorable Point Source # 
Instance details

Methods

sizeOf :: Point -> Int #

alignment :: Point -> Int #

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

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

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

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

peek :: Ptr Point -> IO Point #

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