fixed TextArea

This commit is contained in:
梦凌汐 2024-12-06 19:11:49 +08:00
parent e432c9c95d
commit 530483e2eb
3 changed files with 2 additions and 21 deletions

View File

@ -88,7 +88,7 @@ public:
for(int i = 0; i < height && top + i < csbi.dwSize.Y; i++) {
for(int j = 0; j < width && left + j < csbi.dwSize.X; j++) {
SetConsoleCursorPosition(hConsole, {static_cast<short>(left + j), static_cast<short>(top + i)});
printf(" ");
putchar(' ');
}
}
//绘制边框到缓冲区

View File

@ -16,5 +16,6 @@ int main() {
textLine2.draw();
printf("\n");
getchar();
return 0;
}

View File

@ -1,20 +0,0 @@
#include "components/BaseComponent.h"
#include "components/TextLine.h"
#include "utils/RichText.h"
int main() {
RichText richText;
richText = "Hello, World";
richText += StringPart(" with colors!", COLOR_RED);
TextLine textLine(2, 2, 23, 3);
textLine.setText(richText);
textLine.draw();
TextLine textLine2(7, 5, 40, 3);
textLine2.setText(richText + StringPart(" and more colors!", COLOR_LIGHTCYAN));
textLine2.draw();
printf("\n");
return 0;
}