mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-07-13 14:34:36 +02:00
overlapped key output: highlight letters swiped through
This commit is contained in:
committed by
John Sullivan
parent
2de12a90e4
commit
564eb4536a
23
drw.c
23
drw.c
@ -69,11 +69,15 @@ drw_draw_text(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
||||
}
|
||||
|
||||
void
|
||||
drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
||||
uint32_t w, uint32_t h) {
|
||||
drw_do_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
||||
uint32_t w, uint32_t h, bool over) {
|
||||
cairo_save(d->cairo);
|
||||
|
||||
cairo_set_operator(d->cairo, CAIRO_OPERATOR_SOURCE);
|
||||
if (over) {
|
||||
cairo_set_operator(d->cairo, CAIRO_OPERATOR_OVER);
|
||||
} else {
|
||||
cairo_set_operator(d->cairo, CAIRO_OPERATOR_SOURCE);
|
||||
}
|
||||
|
||||
cairo_rectangle(d->cairo, x, y, w, h);
|
||||
cairo_set_source_rgba(
|
||||
@ -81,11 +85,24 @@ drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
||||
color.bgra[0] / (double)255, color.bgra[3] / (double)255);
|
||||
cairo_fill(d->cairo);
|
||||
|
||||
|
||||
cairo_restore(d->cairo);
|
||||
|
||||
wl_surface_damage(d->surf, x, y, w, h);
|
||||
}
|
||||
|
||||
void
|
||||
drw_fill_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
||||
uint32_t w, uint32_t h) {
|
||||
drw_do_rectangle(d, color, x, y, w, h, false);
|
||||
}
|
||||
|
||||
void
|
||||
drw_over_rectangle(struct drwsurf *d, Color color, uint32_t x, uint32_t y,
|
||||
uint32_t w, uint32_t h) {
|
||||
drw_do_rectangle(d, color, x, y, w, h, true);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
setup_buffer(struct drwsurf *drwsurf) {
|
||||
int stride = drwsurf->width * 4;
|
||||
|
Reference in New Issue
Block a user