Fix calculation of maximum values for swallow parts.
Due my last change, the code was broken by edjes without a group min/max, this happens because edje_object_size_max_get() returns 100000 for these objects, and this was being used as object maximum size. Current fix is a hack: just check for this value, now known as EDJE_INF_MAX_*, but the real solution would be to return 0 (or -1) and check for it in other parts of the code, but it's harder to get right. SVN revision: 32123
This commit is contained in:
parent
8f12e90da0
commit
3500a5c059
|
@ -259,19 +259,35 @@ _edje_part_recalc_single(Edje *ed,
|
|||
{
|
||||
minw = desc->min.w;
|
||||
if (ep->swallow_params.min.w > desc->min.w) minw = ep->swallow_params.min.w;
|
||||
maxw = desc->max.w;
|
||||
if (((ep->swallow_params.max.w >= 0) && (desc->max.w >= 0) &&
|
||||
(ep->swallow_params.max.w < maxw)) ||
|
||||
(ep->swallow_params.max.w >= 0)) maxw = ep->swallow_params.max.w;
|
||||
|
||||
/* XXX TODO: remove need of EDJE_INF_MAX_W, see edje_util.c */
|
||||
if ((ep->swallow_params.max.w <= 0) ||
|
||||
(ep->swallow_params.max.w == EDJE_INF_MAX_W))
|
||||
maxw = desc->max.w;
|
||||
else
|
||||
{
|
||||
if (desc->max.w <= 0)
|
||||
maxw = ep->swallow_params.max.w;
|
||||
else
|
||||
maxw = MIN(ep->swallow_params.max.w, desc->max.w);
|
||||
}
|
||||
}
|
||||
// if (flags & FLAG_Y)
|
||||
{
|
||||
minh = desc->min.h;
|
||||
if (ep->swallow_params.min.h > desc->min.h) minh = ep->swallow_params.min.h;
|
||||
maxh = desc->max.h;
|
||||
if (((ep->swallow_params.max.h >= 0) && (desc->max.h >= 0) &&
|
||||
(ep->swallow_params.max.h < maxh)) ||
|
||||
(ep->swallow_params.max.h >= 0)) maxh = ep->swallow_params.max.h;
|
||||
|
||||
/* XXX TODO: remove need of EDJE_INF_MAX_H, see edje_util.c */
|
||||
if ((ep->swallow_params.max.h <= 0) ||
|
||||
(ep->swallow_params.max.h == EDJE_INF_MAX_H))
|
||||
maxh = desc->max.h;
|
||||
else
|
||||
{
|
||||
if (desc->max.h <= 0)
|
||||
maxh = ep->swallow_params.max.h;
|
||||
else
|
||||
maxh = MIN(ep->swallow_params.max.h, desc->max.h);
|
||||
}
|
||||
}
|
||||
/* relative coords of top left & bottom right */
|
||||
if (flags & FLAG_X)
|
||||
|
|
|
@ -126,6 +126,9 @@ typedef struct _Edje_Spectrum_Color Edje_Spectrum_Color;
|
|||
|
||||
#define PI 3.14159265358979323846
|
||||
|
||||
#define EDJE_INF_MAX_W 100000
|
||||
#define EDJE_INF_MAX_H 100000
|
||||
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_NONE 0
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT 1
|
||||
#define EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY 2
|
||||
|
|
|
@ -1087,7 +1087,8 @@ edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
|
|||
}
|
||||
if (ed->collection->prop.max.w == 0)
|
||||
{
|
||||
if (maxw) *maxw = 100000;
|
||||
/* XXX TODO: convert maxw to 0, fix things that break. */
|
||||
if (maxw) *maxw = EDJE_INF_MAX_W;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1095,7 +1096,8 @@ edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
|
|||
}
|
||||
if (ed->collection->prop.max.h == 0)
|
||||
{
|
||||
if (maxh) *maxh = 100000;
|
||||
/* XXX TODO: convert maxh to 0, fix things that break. */
|
||||
if (maxh) *maxh = EDJE_INF_MAX_H;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue