Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Util.Rect

Description

The Rect type.

Synopsis

Documentation

data Rect Source #

Constructors

Rect Int Int Int Int 

Instances

Instances details
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 # 
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

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 # 
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 () #