render: scrollback indicator: add top margin

This commit is contained in:
Daniel Eklöf 2020-07-26 12:37:57 +02:00
parent 1a65b161dc
commit a98484c6eb
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1420,7 +1420,7 @@ render_scrollback_position(struct terminal *term)
return; return;
case SCROLLBACK_INDICATOR_STYLE_FIXED: case SCROLLBACK_INDICATOR_STYLE_FIXED:
surf_top = margin + term->cell_height; surf_top = term->cell_height - margin;
break; break;
case SCROLLBACK_INDICATOR_STYLE_RELATIVE: { case SCROLLBACK_INDICATOR_STYLE_RELATIVE: {
@ -1428,15 +1428,15 @@ render_scrollback_position(struct terminal *term)
assert(lines > 0); assert(lines > 0);
int on_line = 1 + percent * lines / 100; int on_line = 1 + percent * lines / 100;
surf_top = margin + on_line * term->cell_height; surf_top = on_line * term->cell_height - margin;
break; break;
} }
} }
wl_subsurface_set_position( wl_subsurface_set_position(
win->scrollback_indicator_sub_surface, win->scrollback_indicator_sub_surface,
(term->width - term->margins.right - width) / scale, (term->width - margin - width) / scale,
surf_top / scale); (term->margins.top + surf_top) / scale);
wl_surface_attach(win->scrollback_indicator_surface, buf->wl_buf, 0, 0); wl_surface_attach(win->scrollback_indicator_surface, buf->wl_buf, 0, 0);
wl_surface_damage_buffer(win->scrollback_indicator_surface, 0, 0, width, height); wl_surface_damage_buffer(win->scrollback_indicator_surface, 0, 0, width, height);
wl_surface_set_buffer_scale(win->scrollback_indicator_surface, scale); wl_surface_set_buffer_scale(win->scrollback_indicator_surface, scale);