diff --git a/arch/textwindow.cc b/arch/textwindow.cc index 67d942b..0f20235 100644 --- a/arch/textwindow.cc +++ b/arch/textwindow.cc @@ -44,9 +44,9 @@ void TextWindow::print(const char* str, size_t length, CGA::Attribute attrib) { unsigned x_now, y_now; getPos(x_now, y_now); CGA::show(x_now, y_now, str[i], attrib); - if(from_col+x_now >= to_col){ + if(from_col+x_now >= to_col-1){ x_now = 0; - if(from_row + y_now >= to_row){ + if(from_row + y_now >= to_row-1){ //scrollUp() } else{ diff --git a/main.cc b/main.cc index 7d6b5fc..ae51681 100644 --- a/main.cc +++ b/main.cc @@ -20,6 +20,9 @@ extern "C" int main() { // CGA::show(i, i, i+0x30, CGA::Attribute()); //test textwindow implemantation + TextWindow tw_global = TextWindow(0, 80, 0, 25, true); + tw_global.reset(' ', CGA::Attribute(CGA::LIGHT_GREEN, CGA::BLUE, false)); + TextWindow tw = TextWindow(0, 10, 0, 10, true); tw.reset(); tw.setPos(0,0);