draw only inside current scope
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user