1.1.0
Classes | Functions
Rectangle

Functions and types that deal with rectangles. More...

Classes

struct  fc_rect
 Represents a rectangle with left, top, right and bottom float values. More...
 

Functions

float fc_rect_width (struct fc_rect const *rect)
 Calculates and returns the width of a rect represented by a fc_rect value. More...
 
float fc_rect_height (struct fc_rect const *rect)
 Calculates and returns the height of a rect represented by a fc_rect value. More...
 

Detailed Description

Functions and types that deal with rectangles.

Function Documentation

◆ fc_rect_width()

float fc_rect_width ( struct fc_rect const *  rect)

Calculates and returns the width of a rect represented by a fc_rect value.

This is equivalent to (rect->right - rect->left)

Example

struct fc_rect rect = { 100, 0, 500, 100 };
float width = fc_rect_width(&rect); // returns 400
Parameters
rectA pointer to a fc_rect value to calculate width
Returns
The calculated width
See also
fc_rect_height

◆ fc_rect_height()

float fc_rect_height ( struct fc_rect const *  rect)

Calculates and returns the height of a rect represented by a fc_rect value.

This is equivalent to (rect->bottom - rect->top)

Example

struct fc_rect rect = { 100, 0, 500, 100 };
float width = fc_rect_height(&rect); // returns 100
Parameters
rectA pointer to a fc_rect value to calculate height
Returns
The calculated height
See also
fc_rect_width
fc_rect
Represents a rectangle with left, top, right and bottom float values.
Definition: rect.h:33
fc_rect_height
float fc_rect_height(struct fc_rect const *rect)
Calculates and returns the height of a rect represented by a fc_rect value.
fc_rect_width
float fc_rect_width(struct fc_rect const *rect)
Calculates and returns the width of a rect represented by a fc_rect value.