Logic Fehler changed.
This commit is contained in:
parent
43f042ebdf
commit
00127d17f9
@ -69,8 +69,9 @@ TextRenderer generateTextRender() {
|
||||
vkvm::Color speicialFontColor = vkvm::Color(100, 100, 100);
|
||||
|
||||
// vkvm::FontType fontType = vkvm::getFont();
|
||||
int fontSize = std::stoi(command);
|
||||
// int fontSize = std::stoi(command);
|
||||
|
||||
int fontSize = 2;
|
||||
// int font_id = fontType.getId();
|
||||
std::string fontResourcePath = "../res/font" + std::to_string(3) + ".bmp";
|
||||
std::string fontConfigureFilePath = "../res/font" + std::to_string(3) + ".toml";
|
||||
@ -92,7 +93,7 @@ void test1() {
|
||||
while(command.compare("quit") != 0) {
|
||||
if(command.compare("RenderText") == 0) {
|
||||
vkvm::callEvent(vkvm::EventType::RenderText);
|
||||
outputWindow(vkvm::getHeight(), vkvm::getWidth(), vkvm::getForegroundColor());
|
||||
// outputWindow(vkvm::getHeight(), vkvm::getWidth(), vkvm::getForegroundColor());
|
||||
}
|
||||
|
||||
else if(command.compare("Redraw") == 0) {
|
||||
|
@ -55,6 +55,8 @@ void TextRenderer::update(std::string newText) {
|
||||
int fontNumbersInOneLine = windowWidth / (fontWidth + left_margin);
|
||||
std::vector<std::vector<bool>> characterBitmap;
|
||||
|
||||
// std::cout << fontNumbersInOneLine << "..." << std::endl;
|
||||
|
||||
if(newText.size() < oldTextsize) {
|
||||
clear(currentX, currentY, fontWidth, currentY + fontHeight);
|
||||
}
|
||||
@ -76,10 +78,15 @@ void TextRenderer::update(std::string newText) {
|
||||
|
||||
// blink.setCurrentX(currentX + fontWidth);
|
||||
// blink.setCurrentY(currentY);
|
||||
int tempBlinkX = blinkX;
|
||||
int tempBlinkY = blinkY;
|
||||
|
||||
blinkX = currentX + fontWidth;
|
||||
blinkY = currentY;
|
||||
|
||||
characterBitmap = getCharacter(newText[i], font);
|
||||
clear(tempBlinkX, tempBlinkY, tempBlinkX + 1, tempBlinkY + fontHeight);
|
||||
|
||||
characterBitmap = getCharacter(newText[i - 1], font);
|
||||
|
||||
translateToSharedMemory(characterBitmap, currentX, currentY, speicialFontColor);
|
||||
} else {
|
||||
|
@ -87,7 +87,6 @@ private:
|
||||
|
||||
// void setPixelRange(int startX, int startY, int endX, int endY, int type);
|
||||
std::string adjustText(std::string newText);
|
||||
|
||||
std::string adjustText(std::string newText, int startLine, int endLine);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user