diff --git a/paint/sources/functions.h b/paint/sources/functions.h index 8b00f948..ab433a59 100644 --- a/paint/sources/functions.h +++ b/paint/sources/functions.h @@ -674,9 +674,9 @@ void tab_meshes_set_override(mesh_object_t *o, i32 mat_i i32 tab_meshes_get_override(mesh_object_t *o); void tab_meshes_on_material_deleted(i32 deleted_index); void tab_meshes_on_material_reordered(i32 old_index, i32 new_index); -void tab_meshes_draw_transform_loc(mesh_object_t *o); -void tab_meshes_draw_transform_rot(mesh_object_t *o); -void tab_meshes_draw_transform_scale(mesh_object_t *o); +void tab_meshes_draw_transform_loc(mesh_object_t *o, char *ns); +void tab_meshes_draw_transform_rot(mesh_object_t *o, char *ns); +void tab_meshes_draw_transform_scale(mesh_object_t *o, char *ns); void util_particle_init_physics(); void util_particle_update(); void tab_layers_apply_filter(i32 filter); diff --git a/paint/sources/ui/tab_layers.c b/paint/sources/ui/tab_layers.c index 36543055..365e96cc 100644 --- a/paint/sources/ui/tab_layers.c +++ b/paint/sources/ui/tab_layers.c @@ -373,7 +373,7 @@ void tab_layers_draw_layer_slot_full(slot_layer_t *l, i32 i) { if (parent_hidden) { col -= 0x99000000; } - if (ui_sub_image(icons, col, r->h, r->x, r->y, r->w, r->h) == UI_STATE_RELEASED) { + if (ui_sub_image(icons, col, 18 * UI_SCALE(), r->x, r->y, r->w, r->h) == UI_STATE_RELEASED) { tab_layers_layer_toggle_visible(l); } @@ -436,7 +436,7 @@ void tab_layers_draw_layer_slot_full(slot_layer_t *l, i32 i) { bool in_focus = g_ui->input_x > g_ui->_window_x && g_ui->input_x < g_ui->_window_x + g_ui->_window_w && g_ui->input_y > g_ui->_window_y && g_ui->input_y < g_ui->_window_y + g_ui->_window_h; - if (in_focus && g_ui->is_delete_down && tab_layers_can_delete(g_context->layer)) { + if (in_focus && !g_ui->is_typing && g_ui->is_delete_down && tab_layers_can_delete(g_context->layer)) { g_ui->is_delete_down = false; sys_notify_on_next_frame(&tab_layers_draw_layer_slot_full_delete_layer, NULL); } diff --git a/paint/sources/ui/tab_meshes.c b/paint/sources/ui/tab_meshes.c index 6426e88b..03cb33b7 100644 --- a/paint/sources/ui/tab_meshes.c +++ b/paint/sources/ui/tab_meshes.c @@ -149,12 +149,12 @@ void tab_meshes_duplicate_next_frame(void *_) { sim_duplicate(); } -void tab_meshes_draw_transform_loc(mesh_object_t *o) { +void tab_meshes_draw_transform_loc(mesh_object_t *o, char *ns) { transform_t *t = o->base->transform; bool changed = false; f32 f = 0.0; - ui_handle_t *h = ui_handle(__ID__); + ui_handle_t *h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(t->loc.x)); f = parse_float(ui_text_input(h, "X", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -162,7 +162,7 @@ void tab_meshes_draw_transform_loc(mesh_object_t *o) { t->loc.x = f; } - h = ui_handle(__ID__); + h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(t->loc.y)); f = parse_float(ui_text_input(h, "Y", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -170,7 +170,7 @@ void tab_meshes_draw_transform_loc(mesh_object_t *o) { t->loc.y = f; } - h = ui_handle(__ID__); + h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(t->loc.z)); f = parse_float(ui_text_input(h, "Z", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -184,14 +184,14 @@ void tab_meshes_draw_transform_loc(mesh_object_t *o) { } } -void tab_meshes_draw_transform_rot(mesh_object_t *o) { +void tab_meshes_draw_transform_rot(mesh_object_t *o, char *ns) { transform_t *t = o->base->transform; vec4_t rot = quat_get_euler(t->rot); rot = vec4_mult(rot, 180 / 3.141592); bool changed = false; f32 f = 0.0; - ui_handle_t *h = ui_handle(__ID__); + ui_handle_t *h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(rot.x)); f = parse_float(ui_text_input(h, "X", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -199,7 +199,7 @@ void tab_meshes_draw_transform_rot(mesh_object_t *o) { rot.x = f; } - h = ui_handle(__ID__); + h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(rot.y)); f = parse_float(ui_text_input(h, "Y", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -207,7 +207,7 @@ void tab_meshes_draw_transform_rot(mesh_object_t *o) { rot.y = f; } - h = ui_handle(__ID__); + h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(rot.z)); f = parse_float(ui_text_input(h, "Z", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -223,12 +223,12 @@ void tab_meshes_draw_transform_rot(mesh_object_t *o) { } } -void tab_meshes_draw_transform_scale(mesh_object_t *o) { +void tab_meshes_draw_transform_scale(mesh_object_t *o, char *ns) { transform_t *t = o->base->transform; bool changed = false; f32 f = 0.0; - ui_handle_t *h = ui_handle(__ID__); + ui_handle_t *h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(t->scale.x)); f = parse_float(ui_text_input(h, "X", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -236,7 +236,7 @@ void tab_meshes_draw_transform_scale(mesh_object_t *o) { t->scale.x = f; } - h = ui_handle(__ID__); + h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(t->scale.y)); f = parse_float(ui_text_input(h, "Y", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -244,7 +244,7 @@ void tab_meshes_draw_transform_scale(mesh_object_t *o) { t->scale.y = f; } - h = ui_handle(__ID__); + h = ui_handle(string("%s%s", __ID__, ns)); h->text = string_copy(f32_to_string2(t->scale.z)); f = parse_float(ui_text_input(h, "Z", UI_ALIGN_LEFT, true, false)); if (h->changed) { @@ -287,15 +287,15 @@ void tab_meshes_draw_context_menu() { ui_row4(); ui_text("Loc", UI_ALIGN_LEFT, 0x00000000); - tab_meshes_draw_transform_loc(o); + tab_meshes_draw_transform_loc(o, "menu"); ui_row4(); ui_text("Rot", UI_ALIGN_LEFT, 0x00000000); - tab_meshes_draw_transform_rot(o); + tab_meshes_draw_transform_rot(o, "menu"); ui_row4(); ui_text("Scale", UI_ALIGN_LEFT, 0x00000000); - tab_meshes_draw_transform_scale(o); + tab_meshes_draw_transform_scale(o, "menu"); ui_row4(); ui_text("Dim", UI_ALIGN_LEFT, 0x00000000); @@ -772,7 +772,7 @@ void tab_meshes_draw_mesh_slot(mesh_object_t *o, i32 i) { g_ui->_x = uix + 4; g_ui->_y = uiy + 3 + center; i32 col = g_theme->HOVER_COL + 0x00282828; - if (ui_sub_image(icons, col, r->h, r->x, r->y, r->w, r->h) == UI_STATE_RELEASED) { + if (ui_sub_image(icons, col, 18 * UI_SCALE(), r->x, r->y, r->w, r->h) == UI_STATE_RELEASED) { o->base->visible = !o->base->visible; tab_meshes_apply_visible(o); } @@ -874,7 +874,7 @@ void tab_meshes_draw_mesh_slot(mesh_object_t *o, i32 i) { bool in_focus = g_ui->input_x > g_ui->_window_x && g_ui->input_x < g_ui->_window_x + g_ui->_window_w && g_ui->input_y > g_ui->_window_y && g_ui->input_y < g_ui->_window_y + g_ui->_window_h; - if (in_focus && g_ui->is_delete_down && g_project->_->paint_objects->length > 1) { + if (in_focus && !g_ui->is_typing && g_ui->is_delete_down && g_project->_->paint_objects->length > 1) { g_ui->is_delete_down = false; sys_notify_on_next_frame(&tab_meshes_draw_context_menu_delete, g_context->paint_object); } diff --git a/paint/sources/ui/ui_header.c b/paint/sources/ui/ui_header.c index a4bcbc6a..1c63a396 100644 --- a/paint/sources/ui/ui_header.c +++ b/paint/sources/ui/ui_header.c @@ -579,17 +579,17 @@ void ui_header_draw_tool_properties() { g_ui->_w = math_floor(34 * sc); ui_text("Loc", UI_ALIGN_LEFT, 0x00000000); g_ui->_w = math_floor(48 * sc); - tab_meshes_draw_transform_loc(o); + tab_meshes_draw_transform_loc(o, "header"); g_ui->_w = math_floor(34 * sc); ui_text("Rot", UI_ALIGN_LEFT, 0x00000000); g_ui->_w = math_floor(48 * sc); - tab_meshes_draw_transform_rot(o); + tab_meshes_draw_transform_rot(o, "header"); g_ui->_w = math_floor(40 * sc); ui_text("Scale", UI_ALIGN_LEFT, 0x00000000); g_ui->_w = math_floor(48 * sc); - tab_meshes_draw_transform_scale(o); + tab_meshes_draw_transform_scale(o, "header"); g_ui->_w = _w; } diff --git a/paint/sources/util/util_shortcut.c b/paint/sources/util/util_shortcut.c index f10ffd8b..356b0bf8 100644 --- a/paint/sources/util/util_shortcut.c +++ b/paint/sources/util/util_shortcut.c @@ -97,7 +97,7 @@ void util_shortcut_global() { } #ifdef IRON_LINUX - if (operator_shortcut("alt+enter", SHORTCUT_TYPE_STARTED)) { + if (g_ui->is_alt_down && g_ui->is_key_pressed && g_ui->key_code == KEY_CODE_RETURN) { base_toggle_fullscreen(); } #endif