package gg

  1. Overview
  2. Docs

Module Gg.Size2Source

Sizes in 2D space.

In 2D space, width is the extent along the x-axis and height the extent along the y-axis.

Sourcetype t = size2

The type for 2D sizes.

Sourceval dim : int

dim is the dimension of sizes of type size2.

Constructors, accessors and constants

Sourceval v : float -> float -> size2

v w h is a size of width w and height h.

Sourceval w : size2 -> float

w s is the width of s.

Sourceval h : size2 -> float

h s is the height of s.

Sourceval zero : size2

zero is the zero size, zero width and height.

Sourceval unit : size2

unit is the unit size, one width and height.

Functions

Sourceval aspect : size2 -> float

aspect s is w s /. h s.

Sourceval of_w : float -> aspect:float -> size2

of_w w aspect is v w (w /. aspect).

Sourceval of_h : float -> aspect:float -> size2

of_h h aspect is v (h *. aspect) h.