draw only inside current scope

This commit is contained in:
2026-01-16 16:32:19 +05:00
parent f650e568d6
commit f4ed55a495
4 changed files with 107 additions and 33 deletions

View File

@@ -179,10 +179,10 @@ typedef struct TimScrollItem {
typedef struct TimScrollState {
TimScrollItem* items;
u32 len;
u32 cur;
i32 len;
i32 cur;
bool draw_border;
bool show_scroll_bar_horizontal;
bool show_scroll_bar_vertical;
bool use_mouse_wheel;
} TimScrollState;
@@ -264,6 +264,15 @@ i32 tim_enter_scope(i32 x, i32 y, i32 w, i32 h);
// exit scope and pop stack
i32 tim_exit_scope(void);
static inline bool tim_rect_does_fit(TimRect r){
return (
r.x >= 0 && r.y >= 0 &&
r.w >= 0 && r.h >= 0 &&
r.x + r.w <= tim->w &&
r.y + r.h <= tim->h
);
}
#pragma endregion