forked from enlightenment/efl
evas - fix up border adjust improvement from last night. handles overlap now
This commit is contained in:
parent
6f2871a305
commit
1e9d4bf28f
|
@ -3967,25 +3967,26 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
|
||||||
br = o->cur->border.r;
|
br = o->cur->border.r;
|
||||||
bt = o->cur->border.t;
|
bt = o->cur->border.t;
|
||||||
bb = o->cur->border.b;
|
bb = o->cur->border.b;
|
||||||
if ((bl + br) > imagew)
|
// fix impossible border settings if img pixels not enough
|
||||||
|
if ((bl + br) > imw)
|
||||||
{
|
{
|
||||||
bl = imagew / 2;
|
int b0 = bl, b1 = br;
|
||||||
br = imagew - bl;
|
|
||||||
|
if ((bl + br) > 0)
|
||||||
|
{
|
||||||
|
bl = (bl * imw) / (bl + br);
|
||||||
|
br = imw - bl;
|
||||||
}
|
}
|
||||||
if ((bl + br) > imagew)
|
|
||||||
{
|
|
||||||
bl = imagew / 2;
|
|
||||||
br = imagew - bl;
|
|
||||||
}
|
}
|
||||||
if ((bt + bb) > imageh)
|
if ((bt + bb) > imh)
|
||||||
{
|
{
|
||||||
bt = imageh / 2;
|
int b0 = bt, b1 = bb;
|
||||||
bb = imageh - bt;
|
|
||||||
|
if ((bt + bb) > 0)
|
||||||
|
{
|
||||||
|
bt = (bt * imh) / (bt + bb);
|
||||||
|
bb = imh - bt;
|
||||||
}
|
}
|
||||||
if ((bt + bb) > imageh)
|
|
||||||
{
|
|
||||||
bt = imageh / 2;
|
|
||||||
bb = imageh - bt;
|
|
||||||
}
|
}
|
||||||
if (o->cur->border.scale != 1.0)
|
if (o->cur->border.scale != 1.0)
|
||||||
{
|
{
|
||||||
|
@ -3998,6 +3999,35 @@ evas_object_image_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, v
|
||||||
{
|
{
|
||||||
bsl = bl; bsr = br; bst = bt; bsb = bb;
|
bsl = bl; bsr = br; bst = bt; bsb = bb;
|
||||||
}
|
}
|
||||||
|
// adjust output border rendering if it doesnt fit
|
||||||
|
if ((bsl + bsr) > iw)
|
||||||
|
{
|
||||||
|
int b0 = bsl, b1 = bsr;
|
||||||
|
|
||||||
|
if ((bsl + bsr) > 0)
|
||||||
|
{
|
||||||
|
bsl = (bsl * iw) / (bsl + bsr);
|
||||||
|
bsr = iw - bsl;
|
||||||
|
}
|
||||||
|
if (b0 > 0) bl = (bl * bsl) / b0;
|
||||||
|
else bl = 0;
|
||||||
|
if (b1 > 0) br = (br * bsr) / b1;
|
||||||
|
else br = 0;
|
||||||
|
}
|
||||||
|
if ((bst + bsb) > ih)
|
||||||
|
{
|
||||||
|
int b0 = bst, b1 = bsb;
|
||||||
|
|
||||||
|
if ((bst + bsb) > 0)
|
||||||
|
{
|
||||||
|
bst = (bst * ih) / (bst + bsb);
|
||||||
|
bsb = ih - bst;
|
||||||
|
}
|
||||||
|
if (b0 > 0) bt = (bt * bst) / b0;
|
||||||
|
else bt = 0;
|
||||||
|
if (b1 > 0) bb = (bb * bsb) / b1;
|
||||||
|
else bb = 0;
|
||||||
|
}
|
||||||
// #--
|
// #--
|
||||||
// |
|
// |
|
||||||
inx = 0; iny = 0;
|
inx = 0; iny = 0;
|
||||||
|
|
Loading…
Reference in New Issue