implemented terminal.clear function
This commit is contained in:
parent
477d08a1e3
commit
4957968eb8
|
@ -657,8 +657,7 @@ public class Terminal {
|
|||
var y = rect.getY() + 1;
|
||||
for(int iy = 0; iy < rect.getWidth() - 2; ++iy) {
|
||||
for(int ix = 0; ix < rect.getWidth() - 2; ++ix) {
|
||||
setBackgroundColor(
|
||||
new Vec2i(x + ix, y + iy),
|
||||
setBackgroundColor(new Vec2i(x + ix, y + iy),
|
||||
backgroundColor
|
||||
);
|
||||
}
|
||||
|
@ -666,6 +665,14 @@ public class Terminal {
|
|||
}
|
||||
}
|
||||
|
||||
public void clear(Color bg) {
|
||||
for(var cell : cells) {
|
||||
cell.halfWidth = false;
|
||||
cell.fullChar = 0;
|
||||
cell.bgColor = bg;
|
||||
}
|
||||
}
|
||||
|
||||
private class Cell {
|
||||
int fullChar;
|
||||
int secondChar;
|
||||
|
|
Loading…
Reference in New Issue