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;

View File

@@ -37,6 +37,16 @@ bool IsLoadWord(wchar_t w) {
return result;
}
bool IsBrace(wchar_t c) {
bool result = c == '{' || c == '}';
return result;
}
bool IsParen(wchar_t c) {
bool result = c == '(' || c == ')';
return result;
}
bool IsAlphabetic(wchar_t a) {
bool result = (a >= 'a' && a <= 'z') || (a >= 'A' && a <= 'Z');
return result;