compositor: handle scrolling of blended window

This commit is contained in:
Björn Linse
2019-06-26 08:29:06 +02:00
parent 10c983fabe
commit 2a2d288228
2 changed files with 48 additions and 2 deletions

View File

@@ -329,7 +329,7 @@ static void compose_line(Integer row, Integer startcol, Integer endcol,
memcpy(linebuf+(col-startcol), grid->chars+off, n * sizeof(*linebuf));
memcpy(attrbuf+(col-startcol), grid->attrs+off, n * sizeof(*attrbuf));
// 'pumblend'
// 'pumblend' and 'winblend'
if (grid->blending) {
for (int i = col-(int)startcol; i < until-startcol; i++) {
bool thru = strequal((char *)linebuf[i], " "); // negative space
@@ -467,7 +467,8 @@ static void ui_comp_grid_scroll(UI *ui, Integer grid, Integer top,
bot += curgrid->comp_row;
left += curgrid->comp_col;
right += curgrid->comp_col;
if (!msg_scroll_mode && kv_size(layers) > curgrid->comp_index+1) {
bool covered = kv_size(layers) > curgrid->comp_index+1 || curgrid->blending;
if (!msg_scroll_mode && covered) {
// TODO(bfredl):
// 1. check if rectangles actually overlap
// 2. calulate subareas that can scroll.