When rewriting a string above another at the same coordinates and size with black color, the original string is not completely deleted. If I use a color other than black, the original string is deleted correctly and the new one is written over it.
Personally I use it in many cases to avoid having to use an intermediate buffer (sprite) or draw a filled box on top of the old text before drawing the new text.
Expected Behavior ( 期待される動作 )
I know that this is not the AdafruitGFX library but since it shares many things and since if I use another color other than black it works correctly, here is the idea of the procedure I use:
Garbage is displayed, it does not overwrite correctly
Steps to reproduce ( 再現のための前提条件 )
Use TFT_BLACK, TFT_BLACK on last setTextColor for FAIL (In theory, the specified number should be "drawn in black", meaning nothing would be seen since it would simulate a deletion of the text)
Use TFT_RED, TFT_BLACK on last setTextColor for WORK (The previous text is completely erased and the new text is displayed in red correctly)
Code to reproduce this issue ( 再現させるためのコード )
void setup()
{
// ... LGFX init (custom pins) (my pointer LGFX is screen)
screen->init();
screen->fillScreen(TFT_BLACK);
screen->setCursor(100, 100);
screen->setTextSize(2);
screen->setTextColor(TFT_WHITE, TFT_BLACK);
screen->print("0123456789");
screen->setCursor(100, 100);
screen->setTextSize(2);
screen->setTextColor(TFT_RED, TFT_BLACK); // THIS WORKS, CHANGE FIRST TFT_RED to TFT_BLACK FOR BUG
screen->print("9876543210");
}
This is the picture reflecting the BUG:
This is the picture working FINE (using color != TFT_BLACK):
Maybe it's not a bug, but I assumed I could use the TFT_BLACK color to simulate text deletion in certain cases
Environment ( 実行環境 )
Problem Description ( 問題の内容 )
When rewriting a string above another at the same coordinates and size with black color, the original string is not completely deleted. If I use a color other than black, the original string is deleted correctly and the new one is written over it.
Personally I use it in many cases to avoid having to use an intermediate buffer (sprite) or draw a filled box on top of the old text before drawing the new text.
Expected Behavior ( 期待される動作 )
I know that this is not the AdafruitGFX library but since it shares many things and since if I use another color other than black it works correctly, here is the idea of the procedure I use:
Overwriting Text with the Built-In Font
Actual Behavior ( 実際の動作 )
Garbage is displayed, it does not overwrite correctly
Steps to reproduce ( 再現のための前提条件 )
Code to reproduce this issue ( 再現させるためのコード )
This is the picture reflecting the BUG:
This is the picture working FINE (using color != TFT_BLACK):
Maybe it's not a bug, but I assumed I could use the TFT_BLACK color to simulate text deletion in certain cases