Module Gg.Size2
type t
= size2
The type for 2D sizes.
val dim : int
dim
is the dimension of sizes of typesize2
.
Constructors, accessors and constants
val v : float -> float -> size2
v w h
is a size of widthw
and heighth
.
val w : size2 -> float
w s
is the width ofs
.
val h : size2 -> float
h s
is the height ofs
.
val zero : size2
zero
is the zero size, zero width and height.
val unit : size2
unit
is the unit size, one width and height.
Functions
val aspect : size2 -> float
aspect s
isw s /. h s
.
val of_w : float -> aspect:float -> size2
of_w w aspect
isv w (w /. aspect)
.
val of_h : float -> aspect:float -> size2
of_h h aspect
isv (h *. aspect) h
.