mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-03-13 02:42:47 +01:00
Remove black boxes
This isn't a good way to solve this, and cause restrictions and breakages. We should find a better way to enforce text inside of keys, probably using a second buffer to write into.
This commit is contained in:
parent
3752d0e392
commit
fa659b4584
13
drw.c
13
drw.c
@ -45,18 +45,7 @@ drw_draw_text(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
||||
int width, height;
|
||||
pango_layout_get_pixel_size(d->layout, &width, &height);
|
||||
|
||||
// if a word is too long, cairo let it, and ignore our width
|
||||
if (width < (w - (b*2))) {
|
||||
cairo_rel_move_to(d->cairo, - width / 2, 0);
|
||||
} else {
|
||||
cairo_rel_move_to(d->cairo, - (w / 2) + b, 0);
|
||||
}
|
||||
|
||||
if (height < (h - (b*2))) {
|
||||
cairo_rel_move_to(d->cairo, 0, - height / 2);
|
||||
} else {
|
||||
cairo_rel_move_to(d->cairo, 0, - (h / 2) + b);
|
||||
}
|
||||
cairo_rel_move_to(d->cairo, - width / 2, - height / 2);
|
||||
|
||||
pango_cairo_show_layout(d->cairo, d->layout);
|
||||
cairo_restore(d->cairo);
|
||||
|
@ -520,12 +520,6 @@ kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type type) {
|
||||
|
||||
drw_draw_text(d, scheme->text, k->x, k->y, k->w, k->h, KBD_KEY_BORDER, label);
|
||||
|
||||
// cleanup cairo mess right side if words too long
|
||||
drw_do_rectangle(d, kb->scheme.bg, k->x + k->w - KBD_KEY_BORDER, k->y,
|
||||
kb->w, k->h, false);
|
||||
drw_do_rectangle(d, kb->scheme.bg, k->x, k->y + k->h - KBD_KEY_BORDER,
|
||||
kb->h, k->w, false);
|
||||
|
||||
wl_surface_damage(d->surf, k->x, k->y, k->w, k->h);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user