This commit is contained in:
Krzosa Karol
2024-08-05 21:03:19 +02:00
parent e514c29de4
commit f7100ae8ee
6 changed files with 45 additions and 40 deletions

View File

@@ -117,6 +117,13 @@ Rect2 Rect2FromSize(Vec2 pos, Vec2 size) {
return result;
}
Rect2 Rect2MidHalf(Vec2 mid, Vec2 half_size) {
Rect2 result = {};
result.min = mid - half_size;
result.max = mid + half_size;
return result;
}
Rect2 Shrink(Rect2 result, float v) {
result.min.x += v;
result.max.x -= v;