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;