Completely rewrite the reflow code to correctly handle double width

characters (previously they were not accounted for).
This commit is contained in:
nicm
2017-11-15 19:21:24 +00:00
parent aeda2e5808
commit 533a5719c5
4 changed files with 277 additions and 190 deletions

View File

@ -378,7 +378,8 @@ screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px,
gc.bg = mgc->bg;
}
}
screen_write_cell(ctx, &gc);
if (xx + gc.data.width <= px + nx)
screen_write_cell(ctx, &gc);
}
cy++;
screen_write_cursormove(ctx, cx, cy);
@ -410,6 +411,8 @@ screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src,
if (xx >= gd->linedata[yy].cellsize)
break;
grid_get_cell(gd, xx, yy, &gc);
if (xx + gc.data.width > px + nx)
break;
if (!grid_cells_equal(&gc, &grid_default_cell))
grid_view_set_cell(ctx->s->grid, cx, cy, &gc);
cx++;