Basic vertical rendering

- Add height attribute to most particles for height generation on the fly
This commit is contained in:
Kyle Gunger 2023-01-18 03:43:35 -05:00
parent 37b5b02fc4
commit 60c18246d8
23 changed files with 286 additions and 158 deletions

View file

@ -41,13 +41,19 @@ begin_expose(struct exposable *exposable)
{
struct eprivate *e = exposable->private;
int width = e->exposable->begin_expose(e->exposable);
e->exposable->begin_expose(e->exposable);
int width = e->exposable->width;
int height = e->exposable->height;
assert(width >= 0);
if (width > 0)
width += exposable->particle->left_margin + exposable->particle->right_margin;
if (height > 0)
height += exposable->particle->top_margin + exposable->particle->bottom_margin;
exposable->width = width;
exposable->height = height;
return exposable->width;
}
@ -56,7 +62,7 @@ expose(const struct exposable *exposable, pixman_image_t *pix, int x, int y, int
{
struct eprivate *e = exposable->private;
exposable_render_deco(exposable, pix, x, y, height);
exposable_render_deco(exposable, pix, x, y);
e->exposable->expose(
e->exposable, pix, x + exposable->particle->left_margin, y, height);
}