it's working on web and in window, waow

This commit is contained in:
Krzosa Karol
2025-01-22 11:08:16 +01:00
parent 802141a234
commit e54265fcac
24 changed files with 3320 additions and 1957 deletions

View File

@@ -165,7 +165,7 @@ fn ui_signal_t ui_signal_from_box(ui_box_t *box) {
ui_signal_t result = {box};
app_event_t *ev = ui->event;
b32 move = ev->kind == app_event_kind_mouse_move;
// b32 move = ev->kind == app_event_kind_mouse_move;
b32 inside = r2f32_contains(box->final_rect, ev->mouse_pos);
if (ui_is_active_box(box)) {
@@ -624,7 +624,7 @@ fn void ui_demo_update(app_frame_t *frame) {
f32 scrollable_space = (1 - scroller_size);
f32 scroller_norm = scroller_value / (all_items_size);
f32 scroller_percent = scroller_norm * scrollable_space;
f32 scroller_second = scrollable_space - scroller_percent;
// f32 scroller_second = scrollable_space - scroller_percent;
r2f32_cut_top(&ui->top->rect, scroller_percent * scroller_box_size);
ui_box_t *box = ui_build_box_from_id(UILOC, (ui_box_flags_t){.draw_border = true, .draw_rect = true}, ui_idf("slider"));
@@ -648,10 +648,10 @@ fn void ui_demo_update(app_frame_t *frame) {
ui_end_build();
}
rn_begin();
rn_begin(frame);
ui_draw();
rn_draw_stringf(rn_state.main_font, v2f32(0, frame->window_size.y - rn_state.main_font->size), black_color_global, "boxes: %d", ui->allocated_boxes);
rn_end(frame->window_size, white_color_global);
rn_end();
ui_end_frame();
}