Tiny refactor

This commit is contained in:
2024-10-18 16:12:24 +02:00
parent 8ee000ab74
commit 1d5b4499a4
38 changed files with 645 additions and 637 deletions

View File

@@ -1,6 +1,6 @@
ui_full_size_background :: (identifier: s64 = 0, loc := #caller_location) {
ui_set_next_size_x(.PIXELS, xx renderer.render_target_width);
ui_set_next_size_y(.PIXELS, xx renderer.render_target_height);
ui_set_next_size_x(.PIXELS, xx engine.renderer.render_target_width);
ui_set_next_size_y(.PIXELS, xx engine.renderer.render_target_height);
ui_set_next_background_color(.{0.0, 0.0, 0.0, 1.0});
@@ -117,7 +117,7 @@ ui_clickable_label :: (text: string, selected: bool = false, identifier: s64 = 0
ui_toolbar :: (identifier: s64 = 0, loc := #caller_location) {
ui_set_next_background_color(.{0.2,0.2,0.2,1});
ui_set_next_size_x(.PIXELS, xx renderer.render_target_width);
ui_set_next_size_x(.PIXELS, xx engine.renderer.render_target_width);
ui_set_next_size_y(.CHILDREN_SUM);
box := ui_box_make(.DRAW_BACKGROUND | .DRAW_BORDER, get_hash(loc, identifier));
}
@@ -182,7 +182,7 @@ ui_slider :: (value: *float, min: float = 0.0, max: float = 1.0, identifier: s64
ui_set_next_background_color(.{0.5,0.5,0.5,1});
draggable := ui_box(.DRAW_BACKGROUND | .CLICKABLE | .ANIMATE_ON_HOVER);
mouse_delta_x := input.mouse.delta_x;
mouse_delta_x := engine.input.mouse.delta_x;
if draggable.interaction.left_mouse_pressed {
increment := (max - min) / box.rect.w;
<<value = clamp(<<value + mouse_delta_x * increment, min, max);