Edje min_restricted_calc: Fix the fallback calc to calc more correctly.

Ok was shared between width and height and in the error, and in the error
case we don't reset maxw and maxh; This caused maxw and maxh to be added
a couple of times even when not needed. This would cause weird sizing.

SVN revision: 59450
This commit is contained in:
Tom Hacohen 2011-05-16 14:09:08 +00:00
parent 87ec659bc6
commit d66ec4a1e8
1 changed files with 11 additions and 8 deletions

View File

@ -2171,7 +2171,7 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
Edje *ed; Edje *ed;
Evas_Coord pw, ph; Evas_Coord pw, ph;
int maxw, maxh; int maxw, maxh;
int ok; int okw, okh;
int reset_maxwh; int reset_maxwh;
Edje_Real_Part *pep = NULL; Edje_Real_Part *pep = NULL;
Eina_Bool has_non_fixed_tb = EINA_FALSE; Eina_Bool has_non_fixed_tb = EINA_FALSE;
@ -2195,12 +2195,11 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
maxw = 0; maxw = 0;
maxh = 0; maxh = 0;
ok = 1; do
while (ok)
{ {
unsigned int i; unsigned int i;
ok = 0; okw = okh = 0;
ed->dirty = 1; ed->dirty = 1;
#ifdef EDJE_CALC_CACHE #ifdef EDJE_CALC_CACHE
ed->all_part_change = 1; ed->all_part_change = 1;
@ -2241,7 +2240,7 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
if (w > maxw) if (w > maxw)
{ {
maxw = w; maxw = w;
ok = 1; okw = 1;
pep = ep; pep = ep;
didw = 1; didw = 1;
} }
@ -2255,7 +2254,7 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
if (h > maxh) if (h > maxh)
{ {
maxh = h; maxh = h;
ok = 1; okh = 1;
pep = ep; pep = ep;
} }
has_non_fixed_tb = EINA_TRUE; has_non_fixed_tb = EINA_TRUE;
@ -2263,11 +2262,14 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
} }
} }
} }
if (ok) if (okw)
{ {
ed->w += maxw; ed->w += maxw;
ed->h += maxh;
if (ed->w < restrictedw) ed->w = restrictedw; if (ed->w < restrictedw) ed->w = restrictedw;
}
if (okh)
{
ed->h += maxh;
if (ed->h < restrictedh) ed->h = restrictedh; if (ed->h < restrictedh) ed->h = restrictedh;
} }
if ((ed->w > 4000) || (ed->h > 4000)) if ((ed->w > 4000) || (ed->h > 4000))
@ -2292,6 +2294,7 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
} }
} }
} }
while (okw || okh);
ed->min.w = ed->w; ed->min.w = ed->w;
ed->min.h = ed->h; ed->min.h = ed->h;