mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-05 01:40:41 -05:00
render: scrollback indicator: add top margin
This commit is contained in:
parent
1a65b161dc
commit
a98484c6eb
1 changed files with 4 additions and 4 deletions
8
render.c
8
render.c
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue