git-svn-id: svn://db.shs.com.ru/pip@247 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -76,8 +76,7 @@ PIScreenDrawer::PIScreenDrawer(PIVector<PIVector<Cell> > & c): cells(c) {
|
||||
|
||||
|
||||
void PIScreenDrawer::clear() {
|
||||
for (int i = 0; i < cells.size_s(); ++i)
|
||||
cells[i].fill(Cell());
|
||||
clear(cells);
|
||||
}
|
||||
|
||||
|
||||
@@ -215,6 +214,30 @@ void PIScreenDrawer::fillRect(int x0, int y0, int x1, int y1, const PIChar & c,
|
||||
}
|
||||
|
||||
|
||||
void PIScreenDrawer::fillRect(int x0, int y0, int x1, int y1, PIVector<PIVector<Cell> > & content) {
|
||||
if (x0 > x1) piSwap(x0, x1);
|
||||
if (y0 > y1) piSwap(y0, y1);
|
||||
int w = x1 - x0;
|
||||
int h = y1 - y0;
|
||||
for (int j = y0; j != h; ++j)
|
||||
if (j >= 0 && j < piMini(height, content.size_s())) {
|
||||
if ((j + y0) >= 0 && (j + y0) < height) {
|
||||
PIVector<Cell> & cv(cells[y0 + j]);
|
||||
PIVector<Cell> & contv(content[j]);
|
||||
for (int i = 0; i != piMini(w, contv.size_s()); ++i)
|
||||
if ((i + x0) >= 0 && (i + x0) < width)
|
||||
cv[x0 + i] = contv[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PIScreenDrawer::clear(PIVector<PIVector<Cell> > & cells) {
|
||||
for (int i = 0; i < cells.size_s(); ++i)
|
||||
cells[i].fill(Cell());
|
||||
}
|
||||
|
||||
|
||||
void PIScreenDrawer::drawText(int x, int y, const PIString & s, Color col_char, Color col_back, CharFlags flags_char) {
|
||||
if (x < 0 || x >= width || y < 0 || y >= height) return;
|
||||
PIVector<Cell> & cv(cells[y]);
|
||||
|
||||
Reference in New Issue
Block a user