|
|
| version 1.1, 2004/08/01 05:31:29 | version 1.3, 2008/06/02 20:07:30 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| BOOL rect_in(const RECT_T *rect, int x, int y) { | BRESULT rect_in(const RECT_T *rect, int x, int y) { |
| if ((rect) && | if ((rect) && |
| (rect->left <= x) && (rect->right > x) && | (rect->left <= x) && (rect->right > x) && |
| Line 26 int rect_num(const RECT_T *rect, int cnt | Line 26 int rect_num(const RECT_T *rect, int cnt |
| return(-1); | return(-1); |
| } | } |
| BOOL rect_isoverlap(const RECT_T *r1, const RECT_T *r2) { | BRESULT rect_isoverlap(const RECT_T *r1, const RECT_T *r2) { |
| if ((r1->left >= r2->right) || | if ((r1->left >= r2->right) || |
| (r1->right <= r2->left) || | (r1->right <= r2->left) || |
| Line 43 void rect_enumout(const RECT_T *tag, con | Line 43 void rect_enumout(const RECT_T *tag, con |
| RECT_T rect; | RECT_T rect; |
| if ((tag != NULL) && (base != NULL) && (outcb != NULL)) { | if ((tag != NULL) && (base != NULL) && (outcb != NULL)) { |
| // base.top -> tag.top | /* base.top -> tag.top */ |
| rect.top = base->top; | rect.top = base->top; |
| rect.bottom = min(tag->top, base->bottom); | rect.bottom = min(tag->top, base->bottom); |
| if (rect.top < rect.bottom) { | if (rect.top < rect.bottom) { |
| Line 53 void rect_enumout(const RECT_T *tag, con | Line 53 void rect_enumout(const RECT_T *tag, con |
| rect.top = rect.bottom; | rect.top = rect.bottom; |
| } | } |
| // -> tag.bottom | /* -> tag.bottom */ |
| rect.bottom = min(tag->bottom, base->bottom); | rect.bottom = min(tag->bottom, base->bottom); |
| if (rect.top < rect.bottom) { | if (rect.top < rect.bottom) { |
| rect.left = base->left; | rect.left = base->left; |
| Line 69 void rect_enumout(const RECT_T *tag, con | Line 69 void rect_enumout(const RECT_T *tag, con |
| rect.top = rect.bottom; | rect.top = rect.bottom; |
| } | } |
| // -> base.bottom | /* -> base.bottom */ |
| rect.bottom = base->bottom; | rect.bottom = base->bottom; |
| if (rect.top < rect.bottom) { | if (rect.top < rect.bottom) { |
| rect.left = base->left; | rect.left = base->left; |