HACK fractional scaling

This commit is contained in:
Kenny Levinsen 2022-04-04 19:36:50 +02:00
parent 68db8ff1f5
commit 4564d78eff
8 changed files with 268 additions and 70 deletions

10
csi.c
View file

@ -1208,7 +1208,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
if (width >= 0 && height >= 0) {
char reply[64];
size_t n = xsnprintf(reply, sizeof(reply), "\033[4;%d;%dt",
height / term->scale, width / term->scale);
(int)round(height / term->scale), (int)round(width / term->scale));
term_to_slave(term, reply, n);
}
break;
@ -1231,8 +1231,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
case 16: { /* report cell size in pixels */
char reply[64];
size_t n = xsnprintf(reply, sizeof(reply), "\033[6;%d;%dt",
term->cell_height / term->scale,
term->cell_width / term->scale);
(int)round(term->cell_height / term->scale),
(int)round(term->cell_width / term->scale));
term_to_slave(term, reply, n);
break;
}
@ -1249,8 +1249,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
tll_foreach(term->window->on_outputs, it) {
char reply[64];
size_t n = xsnprintf(reply, sizeof(reply), "\033[9;%d;%dt",
it->item->dim.px_real.height / term->cell_height / term->scale,
it->item->dim.px_real.width / term->cell_width / term->scale);
(int)round(it->item->dim.px_real.height / term->cell_height / term->scale),
(int)round(it->item->dim.px_real.width / term->cell_width / term->scale));
term_to_slave(term, reply, n);
break;
}