Evas filters: Fix padding in blur with offset

Test case was: blur(ox=40, rx=40);
This would crop the blurred text instead of having proper padding.
This commit is contained in:
Jean-Philippe Andre 2014-02-19 20:03:20 +09:00
parent 538d078cf0
commit 0d9ffc2624
2 changed files with 5 additions and 4 deletions

View File

@ -967,6 +967,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
id = evas_filter_command_blend_add(ctx, drawctx, copybuf->id, blur_out->id, ox, oy, EVAS_FILTER_FILL_MODE_NONE);
cmd->ENFN->context_color_set(cmd->ENDT, drawctx, R, G, B, A);
if (id < 0) goto fail;
ox = oy = 0;
}
if (convert)

View File

@ -1037,10 +1037,10 @@ _blur_padding_update(Evas_Filter_Program *pgm, Evas_Filter_Instruction *instr,
if (rx < 0) rx = 0;
if (ry < 0) ry = 0;
l = rx + in->pad.l - ox;
r = rx + in->pad.r + ox;
t = ry + in->pad.t - oy;
b = ry + in->pad.b + oy;
l = rx + in->pad.l + ((ox < 0) ? (-ox) : 0);
r = rx + in->pad.r + ((ox > 0) ? ox : 0);
t = ry + in->pad.t + ((oy < 0) ? (-oy) : 0);
b = ry + in->pad.b + ((oy > 0) ? oy : 0);
if (out->pad.l < l) out->pad.l = l;
if (out->pad.r < r) out->pad.r = r;