Revision 251
menu work
rectangle.c | ||
---|---|---|
41 | 41 |
uint16_t (rectangle_get_w)(const rectangle_t *p){ return p->w; } |
42 | 42 |
uint16_t (rectangle_get_h)(const rectangle_t *p){ return p->h; } |
43 | 43 |
|
44 |
int (rectangle_collide_point)(const rectangle_t *p, int x, int y) { |
|
45 |
int16_t x0 = p->x, y0 = p->y; |
|
46 |
return (x >= x0 && x <= x0 + p->w) && (y >= y0 && y <= y0 + p->h); |
|
47 |
} |
|
48 |
|
|
44 | 49 |
static void (rectangle_draw_hline)(int16_t x, int16_t y, int16_t l, uint32_t color){ |
45 | 50 |
if(l < 0){ rectangle_draw_hline(x+l, y, -l, color); return; } |
46 | 51 |
for(int16_t x_ = max(0,x); x_ < min(x+l,graph_get_XRes()); ++x_){ |
Also available in: Unified diff