Skip to content

Commit 916ea39

Browse files
authored
fix emote display errors (#1240)
1 parent 983d86a commit 916ea39

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

main/boards/esp-box-3/esp_box3_board.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ class EspBox3Board : public WifiBoard {
129129
esp_lcd_panel_disp_on_off(panel, true);
130130

131131
#if CONFIG_USE_EMOTE_MESSAGE_STYLE
132-
display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT);
132+
display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT);
133133
#else
134-
display_ = new SpiLcdDisplay(panel_io, panel,
135-
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
134+
display_ = new SpiLcdDisplay(panel_io, panel,
135+
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
136136
#endif
137137
}
138138

main/display/emote_display.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ static void SetupUI(const gfx_handle_t engine_handle, EmoteDisplay* const displa
236236
g_obj_anim_eye = gfx_anim_create(engine_handle);
237237
gfx_obj_align(g_obj_anim_eye, GFX_ALIGN_LEFT_MID, 10, 30);
238238
gfx_anim_set_auto_mirror(g_obj_anim_eye, true);
239+
gfx_obj_set_visible(g_obj_anim_eye, false);
239240

240241
g_obj_label_toast = gfx_label_create(engine_handle);
241242
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
290291
InitializeGraphics(panel, &engine_handle_, width, height);
291292

292293
if (display) {
293-
DisplayLockGuard lock(display);
294+
gfx_emote_lock(engine_handle_);
294295
SetupUI(engine_handle_, display);
296+
gfx_emote_unlock(engine_handle_);
295297
}
296298

297299
RegisterCallbacks(panel_io, engine_handle_);
@@ -322,6 +324,7 @@ void EmoteEngine::SetEyes(const std::string &emoji_name, const bool repeat, cons
322324
DisplayLockGuard lock(display);
323325
gfx_anim_set_src(g_obj_anim_eye, emoji_data.data, emoji_data.size);
324326
gfx_anim_set_segment(g_obj_anim_eye, 0, 0xFFFF, fps, repeat);
327+
gfx_obj_set_visible(g_obj_anim_eye, true);
325328
gfx_anim_start(g_obj_anim_eye);
326329
} else {
327330
ESP_LOGW(TAG, "SetEyes: No emoji data found for %s", emoji_name.c_str());

0 commit comments

Comments
 (0)