diff options
| author | Federico Angelilli <code@fedang.net> | 2023-11-15 22:35:41 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2023-11-15 22:35:41 +0100 |
| commit | 22086e50382b99de092899a203e520c30f50b618 (patch) | |
| tree | 90ca79a7e9fedd52b21d458cf91f1fbd8a56bd06 /draw.c | |
| parent | 7d795eede96e08bf7673a3264648b33693adea21 (diff) | |
Add `Connection` to separate xcb setup from window logic
Diffstat (limited to 'draw.c')
| -rw-r--r-- | draw.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -3,7 +3,7 @@ #include <pango/pango-font.h> #include <pango/pango-types.h> -#include "x11.h" +#include "draw.h" #include "log.h" // Make this a state passed to draw @@ -28,7 +28,8 @@ void draw(Window *win) int screen_width, screen_height; window_get_screen_size(win, &screen_width, &screen_height); - int width = round((screen_width - 2 * draw_x_padding) * scale); + int width0 = screen_width - 2 * draw_x_padding; + int width = round(width0 * scale); int height = round(draw_height * scale); cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); @@ -98,7 +99,7 @@ void draw(Window *win) // TODO: Move these somewhere else window_move(win, x, y); - window_resize(win, width, height); + window_resize(win, width0, draw_height); window_paint_surface(win, surface, width, height); cairo_surface_destroy(surface); |
