ui, fix scrolled elements stealing hot
This commit is contained in:
10
src/ui/ui.c
10
src/ui/ui.c
@@ -295,8 +295,8 @@ fn r2f32_t window_rect_from_frame(app_frame_t *frame) {
|
||||
}
|
||||
|
||||
fn void ui__draw_box(app_frame_t *frame, ui_box_t *box) {
|
||||
box->final_rect = box->full_rect;
|
||||
r2f32_t rect = box->final_rect;
|
||||
r2f32_t rect = box->full_rect;
|
||||
box->final_rect = r2f32_intersect(box->full_rect, ui->clip_rect);
|
||||
|
||||
v4f32_t rect_color = primary_color_global;
|
||||
if (!v4f32_is_null(box->background_color)) rect_color = box->background_color;
|
||||
@@ -587,12 +587,13 @@ fn void ui_demo_update(app_frame_t *frame) {
|
||||
ui_box_t *item_box = ui_box0((ui_box_flags_t){.draw_rect = true, .clip_rect = true});
|
||||
ui_set_rect(item_box, r2f32_cut_left(&ui->top->rect, ui_max));
|
||||
|
||||
static f32 scroller_value;
|
||||
ui_set_text_align(ui_text_align_left)
|
||||
ui_set_top(item_box) {
|
||||
for (i32 i = 0; i < lengthof(tweak_table); i += 1) {
|
||||
mt_tweak_t *tweak = tweak_table + i;
|
||||
if (s8_starts_with(tweak->name, s8_lit("_"), false)) continue;
|
||||
if (s8_starts_with(tweak->name, s8_lit("_"), false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tweak->type->kind == type_kind_b32) {
|
||||
b32 *n = (b32 *)tweak->ptr;
|
||||
@@ -613,6 +614,7 @@ fn void ui_demo_update(app_frame_t *frame) {
|
||||
ui_serial_type(&ui_test_event, type(app_event_t));
|
||||
}
|
||||
|
||||
locl f32 scroller_value;
|
||||
// @todo: fix scroller to match mouse
|
||||
defer_block(ui_push_top(scroller_box), ui_pop_top()) {
|
||||
f32 item_count = (f32)item_box->node_count;
|
||||
|
||||
Reference in New Issue
Block a user