- Revert r317171. [1]
- Fix overlapping corners and fix an off-by-one bug. MFC after: 3 days Requested by: emaste [1]
This commit is contained in:
parent
c7d813a93e
commit
e314be0a8d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318326
@ -1150,30 +1150,33 @@ vt_mark_mouse_position_as_dirty(struct vt_device *vd)
|
||||
#endif
|
||||
|
||||
static void
|
||||
vt_set_border(struct vt_device *vd, term_color_t c)
|
||||
vt_set_border(struct vt_device *vd, const term_rect_t *area,
|
||||
const term_color_t c)
|
||||
{
|
||||
term_rect_t *tarea = &vd->vd_curwindow->vw_draw_area;
|
||||
int x, y;
|
||||
vd_drawrect_t *drawrect = vd->vd_driver->vd_drawrect;
|
||||
|
||||
/* Top bar. */
|
||||
for (y = 0; y < tarea->tr_begin.tp_row; y++)
|
||||
for (x = 0; x < vd->vd_width; x++)
|
||||
vd->vd_driver->vd_setpixel(vd, x, y, c);
|
||||
if (drawrect == NULL)
|
||||
return;
|
||||
|
||||
for (y = tarea->tr_begin.tp_row; y < tarea->tr_end.tp_row; y++) {
|
||||
/* Left bar. */
|
||||
for (x = 0; x < tarea->tr_begin.tp_col; x++)
|
||||
vd->vd_driver->vd_setpixel(vd, x, y, c);
|
||||
/* Top bar */
|
||||
if (area->tr_begin.tp_row > 0)
|
||||
drawrect(vd, 0, 0, vd->vd_width - 1,
|
||||
area->tr_begin.tp_row - 1, 1, c);
|
||||
|
||||
/* Right bar. */
|
||||
for (x = tarea->tr_end.tp_col; x < vd->vd_width; x++)
|
||||
vd->vd_driver->vd_setpixel(vd, x, y, c);
|
||||
}
|
||||
/* Left bar */
|
||||
if (area->tr_begin.tp_col > 0)
|
||||
drawrect(vd, 0, area->tr_begin.tp_row,
|
||||
area->tr_begin.tp_col - 1, area->tr_end.tp_row - 1, 1, c);
|
||||
|
||||
/* Bottom bar. */
|
||||
for (y = tarea->tr_end.tp_row; y < vd->vd_height; y++)
|
||||
for (x = 0; x < vd->vd_width; x++)
|
||||
vd->vd_driver->vd_setpixel(vd, x, y, c);
|
||||
/* Right bar */
|
||||
if (area->tr_end.tp_col < vd->vd_width)
|
||||
drawrect(vd, area->tr_end.tp_col, area->tr_begin.tp_row,
|
||||
vd->vd_width - 1, area->tr_end.tp_row - 1, 1, c);
|
||||
|
||||
/* Bottom bar */
|
||||
if (area->tr_end.tp_row < vd->vd_height)
|
||||
drawrect(vd, 0, area->tr_end.tp_row, vd->vd_width - 1,
|
||||
vd->vd_height - 1, 1, c);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -1241,7 +1244,7 @@ vt_flush(struct vt_device *vd)
|
||||
if (vd->vd_flags & VDF_INVALID) {
|
||||
vd->vd_flags &= ~VDF_INVALID;
|
||||
|
||||
vt_set_border(vd, TC_BLACK);
|
||||
vt_set_border(vd, &vw->vw_draw_area, TC_BLACK);
|
||||
vt_termrect(vd, vf, &tarea);
|
||||
if (vt_draw_logo_cpus)
|
||||
vtterm_draw_cpu_logos(vd);
|
||||
|
Loading…
Reference in New Issue
Block a user