~earboxer/suggpicker

75c8fb0a3f817dfbcb04e73f0b43ba9d38456fb4 — Zach DeCook 1 year, 5 months ago af63ed2
keyboard: Progressively allocate remainder pixels

So the keyboard always fills the width of the screen,
and the width is distributed evenly
1 files changed, 5 insertions(+), 0 deletions(-)

M keyboard.c
M keyboard.c => keyboard.c +5 -0
@@ 29,11 29,16 @@ kbd_init_suggs(struct key *suggs, uint32_t width, uint32_t height) {

	struct key *k = suggs;
	double rowlength = kbd_get_row_length(k);
	uint8_t i = 0;
	while (k->label != NULL) {
		k->x = x;
		k->y = y;
		k->w = width / rowlength;
		x += k->w;
		i++;
		if (x < (width * i) / rowlength) {
			k->w++; x++;
		}
		k->h = keyheight;
		k++;
	}