Weiter Logic Fehler changed.

This commit is contained in:
my 2019-12-18 17:40:21 +01:00
parent 00127d17f9
commit c58f4a6af8
2 changed files with 18 additions and 10 deletions

View File

@ -73,22 +73,27 @@ void TextRenderer::update(std::string newText) {
if(newText[i] == specialCharacter) { if(newText[i] == specialCharacter) {
space -= 1; space -= 1;
currentX = ((i + space) % fontNumbersInOneLine) * (fontWidth + left_margin); int tempBlinkX = blinkX;
currentY = ((i + space) / fontNumbersInOneLine) * (fontHeight + bottom_margin); int tempBlinkY = blinkY;
int tempSpecialCharacterCurrentX = specialCharacterCurrentX;
int tempSpecialCharacterCurrentY = specialCharacterCurrentY;
char tempSpecialChar = _specialCharacter;
specialCharacterCurrentX = ((i + space) % fontNumbersInOneLine) * (fontWidth + left_margin);
specialCharacterCurrentY = ((i + space) / fontNumbersInOneLine) * (fontHeight + bottom_margin);
// blink.setCurrentX(currentX + fontWidth); // blink.setCurrentX(currentX + fontWidth);
// blink.setCurrentY(currentY); // blink.setCurrentY(currentY);
int tempBlinkX = blinkX;
int tempBlinkY = blinkY;
blinkX = currentX + fontWidth; blinkX = specialCharacterCurrentX + fontWidth;
blinkY = currentY; blinkY = specialCharacterCurrentY;
_specialCharacter = newText[i - 1];
characterBitmap = getCharacter(_specialCharacter, font);
translateToSharedMemory(characterBitmap, specialCharacterCurrentX, specialCharacterCurrentY, speicialFontColor);
clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight); clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight);
translateToSharedMemory(getCharacter(tempSpecialChar), tempSpecialCharacterCurrentX, tempSpecialCharacterCurrentY, fontColor);
characterBitmap = getCharacter(newText[i - 1], font);
translateToSharedMemory(characterBitmap, currentX, currentY, speicialFontColor);
} else { } else {
currentLine = ((i + space) / fontNumbersInOneLine); currentLine = ((i + space) / fontNumbersInOneLine);

View File

@ -57,6 +57,9 @@ private:
Font font; Font font;
char returnCharacter = '\n'; char returnCharacter = '\n';
char specialCharacter = -127; char specialCharacter = -127;
int specialCharacterCurrentX;
int specialCharacterCurrentY;
char _specialCharacter;
int fontSize = 1; int fontSize = 1;
int left_margin = 1; int left_margin = 1;
int bottom_margin = 1; int bottom_margin = 1;