static void
_edje_part_pixel_adjust(Edje *ed,
Edje_Real_Part *ep,
- Edje_Calc_Params *params,
- Eina_Bool round)
+ Edje_Calc_Params *params)
{
- int xw, yh, fxw, fyh;
-
- xw = ABS(params->final.x) + params->final.w;
- yh = ABS(params->final.y) + params->final.h;
-
- if (round)
- {
- fxw = TO_INT_ROUND(ADD(ABS(params->eval.x), params->eval.w));
- fyh = TO_INT_ROUND(ADD(ABS(params->eval.y), params->eval.h));
- }
- else
- {
- fxw = TO_INT(ADD(ABS(params->eval.x), params->eval.w));
- fyh = TO_INT(ADD(ABS(params->eval.y), params->eval.h));
- }
-
/* Adjust rounding to not loose one pixels compared to float
information only when rendering to avoid infinite adjustement
when doing min restricted calc */
- if (xw < fxw)
+ if (ABS(params->final.x) + params->final.w < TO_INT(ADD(ABS(params->eval.x), params->eval.w)))
{
if (!ed->calc_only)
{
ep->invalidate = EINA_TRUE;
}
}
- else if (xw > fxw)
+ else if (ABS(params->final.x) + params->final.w > TO_INT(ADD(ABS(params->eval.x), params->eval.w)))
{
if (!ed->calc_only)
{
ep->invalidate = EINA_TRUE;
}
}
-
- if (yh < fyh)
+ if (ABS(params->final.y) + params->final.h < TO_INT(ADD(ABS(params->eval.y), params->eval.h)))
{
if (!ed->calc_only)
{
ep->invalidate = EINA_TRUE;
}
}
- else if (yh > fyh)
+ else if (ABS(params->final.y) + params->final.h > TO_INT(ADD(ABS(params->eval.y), params->eval.h)))
{
if (!ed->calc_only)
{
if (params->final.w < 0 || params->final.h < 0)
ERR("The params final size became negative");
+
}
static void
params->final.w = TO_INT(params->eval.w);
params->final.h = TO_INT(params->eval.h);
- _edje_part_pixel_adjust(ed, ep, params, EINA_FALSE);
+ _edje_part_pixel_adjust(ed, ep, params);
/* fill */
if (ep->part->type == EDJE_PART_TYPE_IMAGE)
_edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Image *)desc)->image.fill, params);
? (_x1) \
: ADD(_x1, MUL(_p, SUB(_x2, _x1))));
-#define INTP(_x1, _x2, _p) TO_INT_ROUND(FINTP(_x1, _x2, _p))
+#define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p))
static void
_map_colors_free(Edje_Calc_Params *pf)
p3->req.w = INTP(p1->req.w, p2->req.w, pos);
p3->req.h = INTP(p1->req.h, p2->req.h, pos);
- _edje_part_pixel_adjust(ed, ep, p3, EINA_TRUE);
+ _edje_part_pixel_adjust(ed, ep, p3);
if (ep->part->dragable.x)
{
#define FROM_DOUBLE(a) eina_f32p32_double_from(a)
#define FROM_INT(a) eina_f32p32_int_from(a)
#define TO_INT(a) eina_f32p32_int_to(a)
-#define TO_INT_ROUND(a) (((a) >= 0.0) \
- ? eina_f32p32_int_to(ADD(a, FROM_DOUBLE(0.5)) \
- : eina_f32p32_int_to(ADD(a, FROM_DOUBLE(-0.5))
+#define TO_INT_ROUND(a) eina_f32p32_int_to(ADD(a, FROM_DOUBLE(0.5)))
#define ZERO 0
#define COS(a) eina_f32p32_cos(a)
#define SIN(a) eina_f32p32_sin(a)
#define FROM_DOUBLE(a) (a)
#define FROM_INT(a) (double)(a)
#define TO_INT(a) (int)(a)
-#define TO_INT_ROUND(a) (((a) >= 0.0) ? (int)(a + 0.5) : (int)(a - 0.5))
+#define TO_INT_ROUND(a) (int)(a + 0.5)
#define ZERO 0.0
#define COS(a) cos(a)
#define SIN(a) sin(a)