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;
|
var y = rect.getY() + 1;
|
||||||
for(int iy = 0; iy < rect.getWidth() - 2; ++iy) {
|
for(int iy = 0; iy < rect.getWidth() - 2; ++iy) {
|
||||||
for(int ix = 0; ix < rect.getWidth() - 2; ++ix) {
|
for(int ix = 0; ix < rect.getWidth() - 2; ++ix) {
|
||||||
setBackgroundColor(
|
setBackgroundColor(new Vec2i(x + ix, y + iy),
|
||||||
new Vec2i(x + ix, y + iy),
|
|
||||||
backgroundColor
|
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 {
|
private class Cell {
|
||||||
int fullChar;
|
int fullChar;
|
||||||
int secondChar;
|
int secondChar;
|
||||||
|
|
Loading…
Reference in New Issue