adafruit / Adafruit-GFX-Library

Adafruit GFX graphics core Arduino library, this is the 'core' class that all our other graphics libraries derive from
https://learn.adafruit.com/adafruit-gfx-graphics-library
Other
2.34k stars 1.53k forks source link

getTextBounds returning an incorrect width #327

Open mrcodetastic opened 3 years ago

mrcodetastic commented 3 years ago

Refer to: https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA/issues/43

Specifically, https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-I2S-DMA/issues/43#issuecomment-740575875

Naios commented 3 years ago

I can confirm the issue. With the default font and default size the text bounds are always returned with an additional pixel in width and height which can also be seen in this image (the text "Huhu" is rasterized using AdafruitGFX and the preferred size is exactly what getTextBounds returns):

image