textbox: include margin when computing needed width

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-12-19 12:58:20 +01:00
parent 8199f1c35a
commit 4379b19eb9
1 changed files with 2 additions and 2 deletions

View File

@ -69,10 +69,10 @@ textbox_geometry(widget_t *widget, int screen, int height, int width)
else if(d->bg_image)
{
double ratio = d->bg_resize ? (double) geometry.height / d->bg_image->height : 1;
geometry.width = MIN(width, MAX(d->extents.width, MAX(d->width, d->bg_image->width * ratio)));
geometry.width = MIN(width, MAX(d->extents.width + d->margin.left + d->margin.right, MAX(d->width, d->bg_image->width * ratio)));
}
else
geometry.width = MIN(d->extents.width, width);
geometry.width = MIN(d->extents.width + d->margin.left + d->margin.right, width);
return geometry;
}