Rect world_viewport = camera_view_port(camera);
Rect viewport = camera_view_port_screen(camera);
-
+
if (rects_overlap(
camera_rect(
camera,
camera,
text_pos) == false) {
if (platform_rect.w > text_rect.w){
- text_pos.x = MAX(float, MIN(float, world_viewport.x, platform_rect.x + platform_rect.w - text_rect.w),
- platform_rect.x);
+ text_pos.x = fmaxf(fminf(world_viewport.x, platform_rect.x + platform_rect.w - text_rect.w),
+ platform_rect.x);
}
if (platform_rect.h > text_rect.h){
- text_pos.y = MAX(float, MIN(float, world_viewport.y, platform_rect.y + platform_rect.h - text_rect.h),
- platform_rect.y);
+ text_pos.y = fmaxf(fminf(world_viewport.y, platform_rect.y + platform_rect.h - text_rect.h),
+ platform_rect.y);
}
}
return a > b ? a : b; \
} \
-MAX_INSTANCE(float)
MAX_INSTANCE(int64_t)
MAX_INSTANCE(size_t)
#define MAX(type, a, b) max_##type(a, b)
return a < b ? a : b; \
} \
-MIN_INSTANCE(float)
MIN_INSTANCE(int64_t)
MIN_INSTANCE(size_t)
#define MIN(type, a, b) min_##type(a, b)