| 85 | } |
| 86 | |
| 87 | PiuBoolean PiuRectangleIntersect(PiuRectangle r0, PiuRectangle r1, PiuRectangle r2) |
| 88 | { |
| 89 | int32_t v1, v2; |
| 90 | int32_t left, right, top, bottom; |
| 91 | if (r1->x < r2->x) |
| 92 | left = r2->x; |
| 93 | else |
| 94 | left = r1->x; |
| 95 | v1 = r1->x + r1->width; |
| 96 | v2 = r2->x + r2->width; |
| 97 | if (v1 < v2) |
| 98 | right = v1; |
| 99 | else |
| 100 | right = v2; |
| 101 | if (r1->y < r2->y) |
| 102 | top = r2->y; |
| 103 | else |
| 104 | top = r1->y; |
| 105 | v1 = r1->y + r1->height; |
| 106 | v2 = r2->y + r2->height; |
| 107 | if (v1 < v2) |
| 108 | bottom = v1; |
| 109 | else |
| 110 | bottom = v2; |
| 111 | r0->x = left; |
| 112 | r0->y = top; |
| 113 | if ((left < right) && (top < bottom)) { |
| 114 | r0->width = right - left; |
| 115 | r0->height = bottom - top; |
| 116 | return 1; |
| 117 | } |
| 118 | r0->width = 0; |
| 119 | r0->height = 0; |
| 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | PiuBoolean PiuRectangleIntersects(PiuRectangle r0, PiuRectangle r1) |
| 124 | { |
no outgoing calls
no test coverage detected