Weiter Logic Fehler changed.
This commit is contained in:
parent
00127d17f9
commit
c58f4a6af8
|
@ -73,22 +73,27 @@ void TextRenderer::update(std::string newText) {
|
|||
if(newText[i] == specialCharacter) {
|
||||
space -= 1;
|
||||
|
||||
currentX = ((i + space) % fontNumbersInOneLine) * (fontWidth + left_margin);
|
||||
currentY = ((i + space) / fontNumbersInOneLine) * (fontHeight + bottom_margin);
|
||||
int tempBlinkX = blinkX;
|
||||
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.setCurrentY(currentY);
|
||||
int tempBlinkX = blinkX;
|
||||
int tempBlinkY = blinkY;
|
||||
|
||||
blinkX = currentX + fontWidth;
|
||||
blinkY = currentY;
|
||||
blinkX = specialCharacterCurrentX + fontWidth;
|
||||
blinkY = specialCharacterCurrentY;
|
||||
_specialCharacter = newText[i - 1];
|
||||
|
||||
characterBitmap = getCharacter(_specialCharacter, font);
|
||||
translateToSharedMemory(characterBitmap, specialCharacterCurrentX, specialCharacterCurrentY, speicialFontColor);
|
||||
|
||||
clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight);
|
||||
|
||||
characterBitmap = getCharacter(newText[i - 1], font);
|
||||
|
||||
translateToSharedMemory(characterBitmap, currentX, currentY, speicialFontColor);
|
||||
translateToSharedMemory(getCharacter(tempSpecialChar), tempSpecialCharacterCurrentX, tempSpecialCharacterCurrentY, fontColor);
|
||||
} else {
|
||||
currentLine = ((i + space) / fontNumbersInOneLine);
|
||||
|
||||
|
|
|
@ -57,6 +57,9 @@ private:
|
|||
Font font;
|
||||
char returnCharacter = '\n';
|
||||
char specialCharacter = -127;
|
||||
int specialCharacterCurrentX;
|
||||
int specialCharacterCurrentY;
|
||||
char _specialCharacter;
|
||||
int fontSize = 1;
|
||||
int left_margin = 1;
|
||||
int bottom_margin = 1;
|
||||
|
|
Loading…
Reference in New Issue