From eac7c9c411fd272bd540405333394257e7926c9c Mon Sep 17 00:00:00 2001 From: anon Date: Fri, 10 Jan 2025 12:50:48 +0100 Subject: [PATCH] rename stretch* to reach* --- dyrect.h | 9 ++++----- examples/raylib_diablo_like.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dyrect.h b/dyrect.h index 9fdf59a..e87fee4 100644 --- a/dyrect.h +++ b/dyrect.h @@ -17,7 +17,6 @@ */ // TODO: further macro hell x, y, width and height so they can be user overwritten too -// TODO: stretch(x|y) naming is meh // TODO: theres a logical inconsistency between ride-hang and rock-paper; either justify it or normalize it @@ -83,8 +82,8 @@ static inline rect_t rock(rect_t dest, rect_t source); static inline rect_t paper(rect_t dest, rect_t source); static inline rect_t next(rect_t source, int n); static inline rect_t after(rect_t source, int n); -static inline rect_t stretchy(rect_t dest, rect_t source); -static inline rect_t stretchx(rect_t dest, rect_t source); +static inline rect_t reachy(rect_t dest, rect_t source); +static inline rect_t reachx(rect_t dest, rect_t source); @@ -364,7 +363,7 @@ rect_t after(rect_t source, int n) { } static inline -rect_t stretchy(rect_t dest, rect_t source) { +rect_t reachy(rect_t dest, rect_t source) { return (dest.y > source.y) ? (rect_t) { .x = source.x, @@ -383,7 +382,7 @@ rect_t stretchy(rect_t dest, rect_t source) { } static inline -rect_t stretchx(rect_t dest, rect_t source) { +rect_t reachx(rect_t dest, rect_t source) { return (dest.x > source.x) ? (rect_t) { .x = source.x, diff --git a/examples/raylib_diablo_like.c b/examples/raylib_diablo_like.c index fbd8d75..4742786 100644 --- a/examples/raylib_diablo_like.c +++ b/examples/raylib_diablo_like.c @@ -13,7 +13,7 @@ void do_resize(void) { hotbar = ride(after(get_screen_rect(), 1), scaley(get_screen_rect(), 0.17f)); healt = ride(after(get_screen_rect(), 1), scale(get_unit_rect(), hotbar.height * 1.2f)); manna = paper(hotbar, healt); - inventory = stretchy(hotbar, paper(get_screen_rect(), scalex(get_screen_rect(), 0.5f))); + inventory = reachy(hotbar, paper(get_screen_rect(), scalex(get_screen_rect(), 0.5f))); inventory_inner = buoyance(inventory, scale(inventory, 0.8f)); inventory_slot = rock(inventory_inner, hang(inventory_inner, scale(get_unit_rect(), inventory_inner.width / 9))); }