diff options
Diffstat (limited to 'src/entry.c')
-rw-r--r-- | src/entry.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/entry.c b/src/entry.c index 6a55741..4ad825a 100644 --- a/src/entry.c +++ b/src/entry.c @@ -64,6 +64,7 @@ void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, u height, width * sizeof(uint32_t) ); + cairo_surface_set_device_scale(surface, scale, scale); cairo_t *cr = cairo_create(surface); entry->cairo[0].surface = surface; @@ -76,8 +77,12 @@ void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, u height, width * sizeof(uint32_t) ); + cairo_surface_set_device_scale(entry->cairo[1].surface, scale, scale); entry->cairo[1].cr = cairo_create(entry->cairo[1].surface); + /* If we're scaling with Cairo, remember to account for that here. */ + width /= scale; + height /= scale; log_debug("Drawing window.\n"); /* Draw the background */ @@ -197,17 +202,6 @@ void entry_init(struct entry *entry, uint8_t *restrict buffer, uint32_t width, u } /* - * TODO: - * This is a dirty hack. The proper thing to do is probably just to - * stop scaling everything manually, set cairo_scale and have done - * with. The reason that isn't how things are currently done is due to - * historic scaling behaviour of tofi. - */ - if (!entry->cursor_theme.thickness_specified) { - entry->cursor_theme.thickness *= scale; - } - - /* * Perform an initial render of the text. * This is done here rather than by calling entry_update to avoid the * unnecessary cairo_paint() of the background for the first frame, |