From 4379b19eb90dcb1e0bb1e50ccb912ea3cfad6f34 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 19 Dec 2008 12:58:20 +0100 Subject: [PATCH] textbox: include margin when computing needed width Signed-off-by: Julien Danjou --- widgets/textbox.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/textbox.c b/widgets/textbox.c index e53987c13..c19887e0d 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -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; }