Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Basic types used across the library.
Synopsis
- type PathStep = Int
- type Path = Seq PathStep
- type Factor = Double
- data Point = Point {}
- data Size = Size {}
- data Rect = Rect {}
- emptyPath :: Path
- rootPath :: Path
- pointInRect :: Point -> Rect -> Bool
- pointInEllipse :: Point -> Rect -> Bool
- addPoint :: Point -> Point -> Point
- subPoint :: Point -> Point -> Point
- mulPoint :: Double -> Point -> Point
- midPoint :: Point -> Point -> Point
- interpolatePoints :: Point -> Point -> Double -> Point
- negPoint :: Point -> Point
- pointToLineDistance :: Point -> Point -> Point -> Double
- coordInRectH :: Double -> Rect -> Bool
- coordInRectY :: Double -> Rect -> Bool
- addToSize :: Size -> Double -> Double -> Maybe Size
- subtractFromSize :: Size -> Double -> Double -> Maybe Size
- moveRect :: Point -> Rect -> Rect
- mulRect :: Double -> Rect -> Rect
- rectCenter :: Rect -> Point
- rectInRect :: Rect -> Rect -> Bool
- rectInRectH :: Rect -> Rect -> Bool
- rectInRectV :: Rect -> Rect -> Bool
- rectsOverlap :: Rect -> Rect -> Bool
- rectBoundedPoint :: Rect -> Point -> Point
- rectFromPoints :: Point -> Point -> Rect
- addToRect :: Rect -> Double -> Double -> Double -> Double -> Maybe Rect
- subtractFromRect :: Rect -> Double -> Double -> Double -> Double -> Maybe Rect
- intersectRects :: Rect -> Rect -> Maybe Rect
Documentation
Point in the 2D space.
Instances
Width and height, used for size requirements.
Instances
Generic Size Source # | |
Show Size Source # | |
Default Size Source # | |
Defined in Monomer.Common.BasicTypes | |
Eq Size Source # | |
HasH Size Double Source # | |
HasW Size Double Source # | |
HasSize ImageDef Size Source # | |
HasSize TextLine Size Source # | |
HasWindowSize (WidgetEnv s e) Size Source # | |
Defined in Monomer.Core.Lens | |
HasWindowSize (MonomerCtx s e) Size Source # | |
Defined in Monomer.Main.Lens windowSize :: Lens' (MonomerCtx s e) Size Source # | |
type Rep Size Source # | |
Defined in Monomer.Common.BasicTypes type Rep Size = D1 ('MetaData "Size" "Monomer.Common.BasicTypes" "monomer-1.6.0.1-inplace" 'False) (C1 ('MetaCons "Size" 'PrefixI 'True) (S1 ('MetaSel ('Just "_sW") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "_sH") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Double))) |
Rectangle, usually representing an area of the screen.
Instances
mulPoint :: Double -> Point -> Point Source #
Multiplies the coordinates of a point by the given factor.
interpolatePoints :: Point -> Point -> Double -> Point Source #
Returns the point between a and b, f units away from a.
pointToLineDistance :: Point -> Point -> Point -> Double Source #
Returns the minimum distance from the point given as first argument to the line formed by the points given as second and third arguments.
coordInRectH :: Double -> Rect -> Bool Source #
Checks if a coordinate is inside the horizontal range of a rect.
coordInRectY :: Double -> Rect -> Bool Source #
Checks if a coordinate is inside the vertical range of a rect.
subtractFromSize :: Size -> Double -> Double -> Maybe Size Source #
Subtracts width and height from a Size.
rectCenter :: Rect -> Point Source #
Returns the middle point of a rect.
rectInRectH :: Rect -> Rect -> Bool Source #
Checks if a rectangle is completely inside a rectangle horizontal area.
rectInRectV :: Rect -> Rect -> Bool Source #
Checks if a rectangle is completely inside a rectangle vertical area.
rectBoundedPoint :: Rect -> Point -> Point Source #
Returns a point bounded to the horizontal and vertical limits of a rect.
rectFromPoints :: Point -> Point -> Rect Source #
Returns a rect using the provided points as boundaries
addToRect :: Rect -> Double -> Double -> Double -> Double -> Maybe Rect Source #
Adds individual x, y, w and h coordinates to a rect.