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() {
std::string command;
std::cout << "fontSize: ";
std::getline(std::cin, command);
// std::string command;
// std::cout << "fontSize: ";
// std::getline(std::cin, command);
int windowWidth = vkvm::getWidth();
int windowHeight = vkvm::getHeight();

View File

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