UI_Intersection_Rect UI_intersect_rects(v2 A_0, v2 A_1, v2 B_0, v2 B_1) {
| 984 | |
| 985 | // UI_Intersection_Rect UI_intersect_rects(v2 A_0, v2 A_1, v2 B_0, v2 B_1) { |
| 986 | UI_Intersection_Rect UI_intersect_rects(UI_Intersection_Rect A, UI_Intersection_Rect B) { |
| 987 | UI_Intersection_Rect result; |
| 988 | |
| 989 | v2 max_tl = v2(max(A.p[0].x, B.p[0].x), max(A.p[0].y, B.p[0].y)); |
| 990 | v2 min_br = v2(min(A.p[1].x, B.p[1].x), min(A.p[1].y, B.p[1].y)); |
| 991 | v2 size = min_br - max_tl; |
| 992 | |
| 993 | if (size.x > 0 && size.y > 0) { |
| 994 | result.p[0] = max_tl; |
| 995 | result.p[1] = max_tl + size; |
| 996 | } |
| 997 | |
| 998 | return result; |
| 999 | } |
| 1000 | |
| 1001 | void UI_set_clip_rects(UI_Context * ctx) { |
| 1002 | auto buffer = UI_get_current_frame_buffer(ctx); |