Gg.Size2
In 2D space, width is the extent along the x-axis and height the extent along the y-axis.
type t = size2
The type for 2D sizes.
dim
is the dimension of sizes of type size2
.
val v : float -> float -> size2
v w h
is a size of width w
and height h
.
val w : size2 -> float
w s
is the width of s
.
val h : size2 -> float
h s
is the height of s
.
val zero : size2
zero
is the zero size, zero width and height.
val unit : size2
unit
is the unit size, one width and height.
val aspect : size2 -> float
aspect s
is w s /. h s
.
val of_w : float -> aspect:float -> size2
of_w w aspect
is v w (w /. aspect)
.
val of_h : float -> aspect:float -> size2
of_h h aspect
is v (h *. aspect) h
.