Skip to main content

Module geometry

Module geometry 

Source
Expand description

§Geometry

These are geometric representations of shapes and coordinates in drawing space within Pushrod. All objects positioned within a window are drawn using these Structs and method calls.

X and Y positions are from the upper left-hand corner of the widget.

Structs§

Point
A position in pixels: x from left to right, y from top to bottom.
Rect
A rectangle: an upper left-hand corner and a size, in pixels.
Size
A width and height in pixels.

Functions§

make_rect
Creates a rectangle from an origin and a size.
origin_point
Returns the point (0, 0).
point
Creates a Point; shorthand for Point::new.
rect
Creates a rectangle from its position and size.
size
Creates a Size; shorthand for Size::new.