Weiter Logic Fehler changed. v2

This commit is contained in:
my 2019-12-18 17:58:22 +01:00
parent c58f4a6af8
commit bd881ef82d
2 changed files with 12 additions and 8 deletions

View File

@ -58,9 +58,9 @@ void renderText(TextRenderer *textRenderer) {
} }
TextRenderer generateTextRender() { TextRenderer generateTextRender() {
std::string command; // std::string command;
std::cout << "fontSize: "; // std::cout << "fontSize: ";
std::getline(std::cin, command); // std::getline(std::cin, command);
int windowWidth = vkvm::getWidth(); int windowWidth = vkvm::getWidth();
int windowHeight = vkvm::getHeight(); int windowHeight = vkvm::getHeight();

View File

@ -58,7 +58,7 @@ void TextRenderer::update(std::string newText) {
// std::cout << fontNumbersInOneLine << "..." << std::endl; // std::cout << fontNumbersInOneLine << "..." << std::endl;
if(newText.size() < oldTextsize) { if(newText.size() < oldTextsize) {
clear(currentX, currentY, fontWidth, currentY + fontHeight); clear(specialCharacterCurrentX, specialCharacterCurrentY, specialCharacterCurrentX + fontWidth + 1, specialCharacterCurrentX + fontHeight + 1);
} }
newText = adjustText(newText); newText = adjustText(newText);
@ -89,11 +89,15 @@ void TextRenderer::update(std::string newText) {
blinkY = specialCharacterCurrentY; blinkY = specialCharacterCurrentY;
_specialCharacter = newText[i - 1]; _specialCharacter = newText[i - 1];
characterBitmap = getCharacter(_specialCharacter, font); if(_specialCharacter != '\n') {
translateToSharedMemory(characterBitmap, specialCharacterCurrentX, specialCharacterCurrentY, speicialFontColor); characterBitmap = getCharacter(_specialCharacter, font);
translateToSharedMemory(characterBitmap, specialCharacterCurrentX, specialCharacterCurrentY, speicialFontColor);
}
clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight); if(specialCharacterCurrentX != tempSpecialCharacterCurrentX && specialCharacterCurrentY != tempSpecialCharacterCurrentY) {
translateToSharedMemory(getCharacter(tempSpecialChar), tempSpecialCharacterCurrentX, tempSpecialCharacterCurrentY, fontColor); clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight);
translateToSharedMemory(getCharacter(tempSpecialChar, font), tempSpecialCharacterCurrentX, tempSpecialCharacterCurrentY, fontColor);
}
} else { } else {
currentLine = ((i + space) / fontNumbersInOneLine); currentLine = ((i + space) / fontNumbersInOneLine);