Skip to content
Myr

render: render_init() now requires width/height

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Eklöf · committed by Daniel Eklöf · parent edca280 · Browse files · 3 files+7 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+7 added−3 removed

  • other:+7 added−3 removed

3 files+7 added−3 removed

modified:main.c+1 added-1 removed
1235 unmodified lines
1236 /* Trigger a 'configure' event, after which we'll have the width */1237 wl_surface_commit(c.wl.surface);1238 wl_display_roundtrip(c.wl.display);12391240 c.render = render_init(font);1240 c.render = render_init(font, width, height);12411242 refresh(&c);12431244 wl_display_dispatch_pending(c.wl.display);
99 unmodified lines
modified:render.c+5 added-1 removed
7 unmodified lines
8#include "log.h"9#include "font.h"1011struct render {12 int width;13 int height;14 cairo_scaled_font_t *regular_font;15};1617static const double x_margin = 20;
253 unmodified lines
271 }272}273274struct render *273render_init(cairo_scaled_font_t *font)275render_init(cairo_scaled_font_t *font, int width, int height)276{277 struct render *render = calloc(1, sizeof(*render));278 render->width = width;279 render->height = height;280 render->regular_font = font;281 return render;282}283
9 unmodified lines
modified:render.h+1 added-1 removed
10 unmodified lines
11 size_t cursor;12};1314struct render;15struct render *render_init(cairo_scaled_font_t *font);15struct render *render_init(cairo_scaled_font_t *font, int width, int height);16void render_destroy(struct render *render);1718void render_prompt(19 const struct render *render, struct buffer *buf,
5 unmodified lines