Linear layout should acknowledge width property

This commit is contained in:
Mid 2025-09-19 23:10:44 +03:00
parent 1ee7d6c26e
commit 05d0c75937

View File

@ -100,6 +100,15 @@ static bool linear_arrange(struct k3MEvent *ev, uint8_t *ud) {
c->x = o->x + padding[3];
c->y = y;
struct k3MProperty *prop = k3MFindProperty(c, k3M_PROP_WIDTH, true);
if(prop) {
if(prop->units[0] == k3M_UNIT_ABSOLUTE) {
c->w = prop->f[0];
} else if(prop->units[0] == k3M_UNIT_PROPORTION) {
c->w = o->w * prop->f[0];
}
}
if(c->w > o->w - padding[1] - padding[3]) {
c->w = o->w - padding[1] - padding[3];
}