render: avoid division

This commit is contained in:
Daniel Eklöf 2019-06-26 20:08:49 +02:00
parent dbd883935b
commit 3349c28fce
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

3
main.c
View file

@ -89,7 +89,8 @@ grid_render_update(struct context *c, struct buffer *buf, const struct damage *d
col = dmg->range.start % cols;
linear_cursor < dmg->range.start + dmg->range.length;
linear_cursor++,
col = (col + 1) % cols,
//col = (col + 1) % cols,
col = col + 1 >= c->term.grid.cols ? 0 : col + 1,
row += col == 0 ? 1 : 0)
{
//LOG_DBG("UPDATE: %d (%dx%d)", linear_cursor, row, col);