forked from enlightenment/efl
evas: fix adjustment logic about image border
Summary: If border left+right >= image width, center area does not rendered. Although adjusement logic, _draw_image()'s src_w can be a 0. This commit try to secure center area at least 1 pixel. This should fix T5057 @fix Reviewers: raster, jypark, jpeg Subscribers: cedric Maniphest Tasks: T5057 Differential Revision: https://phab.enlightenment.org/D4538
This commit is contained in:
parent
6d0a2398ad
commit
090ee28ca4
|
@ -2068,21 +2068,31 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
||||||
bt = o->cur->border.t;
|
bt = o->cur->border.t;
|
||||||
bb = o->cur->border.b;
|
bb = o->cur->border.b;
|
||||||
// fix impossible border settings if img pixels not enough
|
// fix impossible border settings if img pixels not enough
|
||||||
if ((bl + br) > imw)
|
if ((bl + br) > 0)
|
||||||
{
|
{
|
||||||
if ((bl + br) > 0)
|
if ((bl + br) > imw)
|
||||||
{
|
{
|
||||||
bl = (bl * imw) / (bl + br);
|
bl = (bl * imw) / (bl + br);
|
||||||
br = imw - bl;
|
br = imw - bl;
|
||||||
}
|
}
|
||||||
|
if ((bl + br) == imw)
|
||||||
|
{
|
||||||
|
if (bl < br) br--;
|
||||||
|
else bl--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((bt + bb) > imh)
|
if ((bt + bb) > 0)
|
||||||
{
|
{
|
||||||
if ((bt + bb) > 0)
|
if ((bt + bb) > imh)
|
||||||
{
|
{
|
||||||
bt = (bt * imh) / (bt + bb);
|
bt = (bt * imh) / (bt + bb);
|
||||||
bb = imh - bt;
|
bb = imh - bt;
|
||||||
}
|
}
|
||||||
|
if ((bt + bb) == imh)
|
||||||
|
{
|
||||||
|
if (bt < bb) bb--;
|
||||||
|
else bt--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!EINA_DBL_CMP(o->cur->border.scale, 1.0))
|
if (!EINA_DBL_CMP(o->cur->border.scale, 1.0))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue