diff options
| author | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2013-04-23 20:34:52 +0200 |
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2013-04-23 20:36:30 +0200 |
| commit | 048c54fd5b275ac54d7819020485b77e99fcc469 (patch) | |
| tree | cd6b6c5c21b1bef6ccbf56fe7cdd55b33683fc8c /st.c | |
| parent | Now clipping is more clear. (diff) | |
| download | st-048c54fd5b275ac54d7819020485b77e99fcc469.tar.gz st-048c54fd5b275ac54d7819020485b77e99fcc469.zip | |
Fix selecting clearing and BCE
The commit b78c5085f72 changed the st behaviour enabling BCE capability,
that means erase regions using background color. Problem comes when you
clear a region with a selection, because in this case the real mode of the
Glyph is not the value of term.line[y][x], due in drawregion we had enabled
the ATTR_REVERSE bit.
Signed-off-by: Christoph Lohmann <20h@r-36.net>
Diffstat (limited to 'st.c')
| -rw-r--r-- | st.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1410,7 +1410,7 @@ tsetchar(char *c, Glyph *attr, int x, int y) { | |||
| 1410 | 1410 | ||
| 1411 | void | 1411 | void |
| 1412 | tclearregion(int x1, int y1, int x2, int y2) { | 1412 | tclearregion(int x1, int y1, int x2, int y2) { |
| 1413 | int x, y, temp; | 1413 | int x, y, temp, mask; |
| 1414 | 1414 | ||
| 1415 | if(x1 > x2) | 1415 | if(x1 > x2) |
| 1416 | temp = x1, x1 = x2, x2 = temp; | 1416 | temp = x1, x1 = x2, x2 = temp; |
| @@ -1425,7 +1425,9 @@ tclearregion(int x1, int y1, int x2, int y2) { | |||
| 1425 | for(y = y1; y <= y2; y++) { | 1425 | for(y = y1; y <= y2; y++) { |
| 1426 | term.dirty[y] = 1; | 1426 | term.dirty[y] = 1; |
| 1427 | for(x = x1; x <= x2; x++) { | 1427 | for(x = x1; x <= x2; x++) { |
| 1428 | mask = selected(x, y) ? ATTR_REVERSE : 0; | ||
| 1428 | term.line[y][x] = term.c.attr; | 1429 | term.line[y][x] = term.c.attr; |
| 1430 | term.line[y][x].mode ^= mask; | ||
| 1429 | memcpy(term.line[y][x].c, " ", 2); | 1431 | memcpy(term.line[y][x].c, " ", 2); |
| 1430 | } | 1432 | } |
| 1431 | } | 1433 | } |
