From 916ea39fad0f8a10e83e75865c260e44eb50d56e Mon Sep 17 00:00:00 2001 From: Xiaoxia Date: Fri, 26 Sep 2025 06:18:57 +0800 Subject: [PATCH] fix emote display errors (#1240) --- main/boards/esp-box-3/esp_box3_board.cc | 6 +++--- main/display/emote_display.cc | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/main/boards/esp-box-3/esp_box3_board.cc b/main/boards/esp-box-3/esp_box3_board.cc index 3f499597..7e1c6003 100644 --- a/main/boards/esp-box-3/esp_box3_board.cc +++ b/main/boards/esp-box-3/esp_box3_board.cc @@ -129,10 +129,10 @@ private: esp_lcd_panel_disp_on_off(panel, true); #if CONFIG_USE_EMOTE_MESSAGE_STYLE - display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT); + display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT); #else - display_ = new SpiLcdDisplay(panel_io, panel, - DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY); + display_ = new SpiLcdDisplay(panel_io, panel, + DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY); #endif } diff --git a/main/display/emote_display.cc b/main/display/emote_display.cc index 5bed5fae..5c6dec31 100644 --- a/main/display/emote_display.cc +++ b/main/display/emote_display.cc @@ -236,6 +236,7 @@ static void SetupUI(const gfx_handle_t engine_handle, EmoteDisplay* const displa g_obj_anim_eye = gfx_anim_create(engine_handle); gfx_obj_align(g_obj_anim_eye, GFX_ALIGN_LEFT_MID, 10, 30); gfx_anim_set_auto_mirror(g_obj_anim_eye, true); + gfx_obj_set_visible(g_obj_anim_eye, false); g_obj_label_toast = gfx_label_create(engine_handle); gfx_obj_align(g_obj_label_toast, GFX_ALIGN_TOP_MID, 0, 20); @@ -290,8 +291,9 @@ EmoteEngine::EmoteEngine(const esp_lcd_panel_handle_t panel, const esp_lcd_panel InitializeGraphics(panel, &engine_handle_, width, height); if (display) { - DisplayLockGuard lock(display); + gfx_emote_lock(engine_handle_); SetupUI(engine_handle_, display); + gfx_emote_unlock(engine_handle_); } RegisterCallbacks(panel_io, engine_handle_); @@ -322,6 +324,7 @@ void EmoteEngine::SetEyes(const std::string &emoji_name, const bool repeat, cons DisplayLockGuard lock(display); gfx_anim_set_src(g_obj_anim_eye, emoji_data.data, emoji_data.size); gfx_anim_set_segment(g_obj_anim_eye, 0, 0xFFFF, fps, repeat); + gfx_obj_set_visible(g_obj_anim_eye, true); gfx_anim_start(g_obj_anim_eye); } else { ESP_LOGW(TAG, "SetEyes: No emoji data found for %s", emoji_name.c_str());