diff options
| author | iamcheeseman <[email protected]> | 2026-05-21 06:46:48 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-21 06:46:48 -0400 |
| commit | b98d216add98579c3a91b74fa5233f8534200297 (patch) | |
| tree | eb631f8b853ef913806e8a8c0fb52e8eb8aa37a7 /teensy/teensy_math.c | |
| parent | db639fcdc501ac56873f55d1c227e15581ee97c3 (diff) | |
a buncha ui stuff idk even know anymore
Diffstat (limited to 'teensy/teensy_math.c')
| -rw-r--r-- | teensy/teensy_math.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/teensy/teensy_math.c b/teensy/teensy_math.c index 79d89c1..5da800c 100644 --- a/teensy/teensy_math.c +++ b/teensy/teensy_math.c @@ -17,3 +17,22 @@ bool ty_point_in_rect(ty_Vec2 point, ty_Rect rect) point.y > rect.y && point.y < rect.y + rect.h; } + + +ty_Recti ty_recti_shrink(ty_Recti rect, int p) +{ + rect.x += p; + rect.y += p; + rect.w -= p * 2; + rect.h -= p * 2; + return rect; +} + +ty_Recti ty_recti_grow(ty_Recti rect, int p) +{ + rect.x -= p; + rect.y -= p; + rect.w += p * 2; + rect.h += p * 2; + return rect; +} |
