forked from external/yambar
particle/ramp: don’t add margins if all sub-items are zero-width
That is, if all sub-items are zero-width, make sure *we* return a zero width.
This commit is contained in:
parent
def90edde1
commit
af0b7e57d8
1 changed files with 6 additions and 4 deletions
|
@ -37,11 +37,13 @@ begin_expose(struct exposable *exposable)
|
||||||
{
|
{
|
||||||
struct eprivate *e = exposable->private;
|
struct eprivate *e = exposable->private;
|
||||||
|
|
||||||
exposable->width = (
|
int width = e->exposable->begin_expose(e->exposable);
|
||||||
exposable->particle->left_margin +
|
assert(width >= 0);
|
||||||
e->exposable->begin_expose(e->exposable) +
|
|
||||||
exposable->particle->right_margin);
|
|
||||||
|
|
||||||
|
if (width > 0)
|
||||||
|
width += exposable->particle->left_margin + exposable->particle->right_margin;
|
||||||
|
|
||||||
|
exposable->width = width;
|
||||||
return exposable->width;
|
return exposable->width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue