diff --git a/paint/sources/base.c b/paint/sources/base.c index 57af03f7..7fe22410 100644 --- a/paint/sources/base.c +++ b/paint/sources/base.c @@ -1130,7 +1130,6 @@ void ui_base_update(void *_) { g_context->brush_radius += mouse_movement_x / 150.0; g_context->brush_radius = math_max(0.01, math_min(4.0, g_context->brush_radius)); g_context->brush_radius = math_round(g_context->brush_radius * 100) / 100.0; - g_context->brush_radius_handle->f = g_context->brush_radius; } ui_header_handle->redraws = 2; } @@ -1225,13 +1224,11 @@ void ui_base_update(void *_) { else if (operator_shortcut(any_map_get(config_keymap, "brush_radius_decrease"), SHORTCUT_TYPE_REPEAT)) { g_context->brush_radius -= ui_base_get_radius_increment(); g_context->brush_radius = math_max(math_round(g_context->brush_radius * 100) / 100.0, 0.01); - g_context->brush_radius_handle->f = g_context->brush_radius; ui_header_handle->redraws = 2; } else if (operator_shortcut(any_map_get(config_keymap, "brush_radius_increase"), SHORTCUT_TYPE_REPEAT)) { g_context->brush_radius += ui_base_get_radius_increment(); g_context->brush_radius = math_round(g_context->brush_radius * 100) / 100.0; - g_context->brush_radius_handle->f = g_context->brush_radius; ui_header_handle->redraws = 2; } else if (decal_mask) { diff --git a/paint/sources/context.c b/paint/sources/context.c index ca9f83d1..4dfc3398 100644 --- a/paint/sources/context.c +++ b/paint/sources/context.c @@ -126,7 +126,6 @@ context_t *context_create() { c->brush_nodes_angle = 0.0; c->brush_nodes_hardness = 1.0; c->brush_directional = false; - c->brush_radius_handle = ui_handle_create(); c->brush_scale_x = 1.0; c->brush_decal_mask_radius = 0.5; c->brush_decal_mask_radius_handle = ui_handle_create(); @@ -176,7 +175,6 @@ void context_init() { g_context->tool = TOOL_TYPE_BRUSH; g_context->color_picker_previous_tool = TOOL_TYPE_BRUSH; g_context->brush_radius = 0.5; - g_context->brush_radius_handle->f = 0.5; g_context->brush_hardness = 1.0; } diff --git a/paint/sources/tab_scripts.c b/paint/sources/tab_scripts.c index ca31a87f..53657992 100644 --- a/paint/sources/tab_scripts.c +++ b/paint/sources/tab_scripts.c @@ -86,9 +86,14 @@ void tab_scripts_draw(ui_handle_t *htab) { -70, -70, -140, - -90, }, - 4); + 3); + +// #ifndef NDEBUG +// if (g_config->experimental) { +// f32_array_push(row, -90); +// } +// #endif ui_row(row); @@ -109,22 +114,11 @@ void tab_scripts_draw(ui_handle_t *htab) { ui_handle_t *file_handle = ui_handle(__ID__); ui_combo(file_handle, ar, tr("File"), false, UI_ALIGN_LEFT, true); - -#ifndef NDEBUG - bool is_debug = true; -#else - bool is_debug = false; -#endif - - if (!g_config->experimental || !is_debug) { - ui_end_element(); - } - -#ifndef NDEBUG - if (g_config->experimental && ui_icon_button("Run Tests", ICON_PLAY, UI_ALIGN_CENTER)) { - minic_tests(); - } -#endif +// #ifndef NDEBUG +// if (g_config->experimental && ui_icon_button("Run Tests", ICON_PLAY, UI_ALIGN_CENTER)) { +// minic_tests(); +// } +// #endif ui_end_sticky(); diff --git a/paint/sources/types.h b/paint/sources/types.h index 21aebad8..898d4135 100644 --- a/paint/sources/types.h +++ b/paint/sources/types.h @@ -327,7 +327,6 @@ typedef struct context { f32 brush_nodes_hardness; bool brush_directional; f32 brush_radius; - struct ui_handle *brush_radius_handle; f32 brush_scale_x; f32 brush_decal_mask_radius; struct ui_handle *brush_decal_mask_radius_handle; diff --git a/paint/sources/ui_header.c b/paint/sources/ui_header.c index 75212959..aa0c1d76 100644 --- a/paint/sources/ui_header.c +++ b/paint/sources/ui_header.c @@ -416,7 +416,9 @@ void ui_header_draw_tool_properties() { } } else { - g_context->brush_radius = ui_slider(g_context->brush_radius_handle, tr("Radius"), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); + ui_handle_t *brush_radius_handle = ui_handle(__ID__); + brush_radius_handle->f = g_context->brush_radius; + g_context->brush_radius = ui_slider(brush_radius_handle, tr("Radius"), 0.01, 2.0, true, 100.0, true, UI_ALIGN_RIGHT, true); if (ui->is_hovered) { any_map_t *vars = any_map_create(); any_map_set(vars, "brush_radius", any_map_get(config_keymap, "brush_radius"));