Generated by Doxygen 1.8.14
Neographics
Rect

Classes

struct  n_GRect
 

Macros

#define n_GRect(x, y, w, h)   ((n_GRect) {{x, y}, {w, h}})
 
#define n_grect_standardize(a)
 

Typedefs

typedef struct n_GRect n_GRect
 

Functions

n_GPoint n_grect_center_point (n_GRect *rect)
 

Detailed Description

Macro Definition Documentation

◆ n_GRect

#define n_GRect (   x,
  y,
  w,
 
)    ((n_GRect) {{x, y}, {w, h}})

Convenience macro to quickly define a rectangle.

◆ n_grect_standardize

#define n_grect_standardize (   a)
Value:
((a).size.w >= 0 \
? (a).size.h >= 0 \
/* normal */ \
? (n_GRect) { { (a).origin.x, (a).origin.y }, \
{ (a).size.w, (a).size.h }} \
/* switch vertically */ \
: (n_GRect) { { (a).origin.x, (a).origin.y + (a).size.h - 1 }, \
{ (a).size.w, -(a).size.h + 2 }} \
: (a).size.h >= 0 \
/* switch horizontally */ \
? (n_GRect) { { (a).origin.x + (a).size.w - 1, (a).origin.y }, \
{ -(a).size.w + 2, (a).size.h }} \
/* switch horizontally and vertically */ \
: (n_GRect) { { (a).origin.x + (a).size.w - 1, (a).origin.y + (a).size.h - 1 }, \
{ -(a).size.w + 2, -(a).size.h + 2 }})
#define n_GRect(x, y, w, h)
Definition: rect.h:30
Definition: rect.h:22

Convenience macro to standardize a rectangle.

Warning
Differs from the Pebble OS implementation, which is in-place and takes a pointer.

Function Documentation

◆ n_grect_center_point()

n_GPoint n_grect_center_point ( n_GRect rect)

Returns the point at the center of a GRect (will prefer top and/or left at even sizes)