From 325fbe7d0ecd09ab2faf9fbf573ebec2bbd97a7d Mon Sep 17 00:00:00 2001 From: kraus Date: Sun, 11 Dec 2022 09:24:32 +0100 Subject: [PATCH] Bugfix: Clear font_height_mode during setup to ensure correct default values in cases where the u8g2 struct / class is created via dynamic memory allocation (issue #2046) --- ChangeLog | 4 ++-- csrc/u8g2_setup.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ddfba8c..392648aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -303,5 +303,5 @@ https://github.com/olikraus/u8g2 ChangeLog * SSD1316 96x32 (issue 1938) * SH1108 128x160 (issue 1998) * SSD1306 96x39 (issue 1959) - - \ No newline at end of file + * Bugfix: Clear font_height_mode during setup to ensure correct default values in + cases where the u8g2 struct / class is created via dynamic memory allocation (issue 2046) diff --git a/csrc/u8g2_setup.c b/csrc/u8g2_setup.c index 6ba93c0a..4d84a908 100644 --- a/csrc/u8g2_setup.c +++ b/csrc/u8g2_setup.c @@ -85,6 +85,7 @@ void u8g2_SetupBuffer(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, u8g2_ u8g2->font_decode.is_transparent = 0; /* issue 443 */ u8g2->bitmap_transparency = 0; + u8g2->font_height_mode = 0; /* issue 2046 */ u8g2->draw_color = 1; u8g2->is_auto_page_clear = 1;