Geometry Types

Geometry types in the API are always in units of “real” pixels.

typedef int16_t PuglCoord

A pixel coordinate (X or Y) in/of a view.

This type is used in two coordinate spaces: parent-relative coordinates of a view, and view-relative coordinates in a view. Parent-relative coordinates are relative to the top-left of the embedding parent, or to that of a system-specific root. View-relative coordinates are relative to the top-left of the view.

Coordinates must be between -32767 and 32767 inclusive, but should be between -16000 and 16000 (and in practice much smaller) for portability.

typedef uint16_t PuglSpan

A pixel span (width or height) in/of a view.

Spans must be at most 32767, but should be at most 10000 (and in practice much smaller) for portability.

struct PuglArea

A 2-dimensional size in/of a view.

PuglSpan width

Width in pixels.

PuglSpan height

Height in pixels.

struct PuglPoint

A 2-dimensional position in/of a view.

A point may be parent- or view-relative, but the origin (0, 0) is always in the top left.

PuglCoord x

X coordinate.

PuglCoord y

Y coordinate.