forked from enlightenment/efl
svg/loader: refactored the copy of structure.
Reviewers: cedric, jpeg, Hermet Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4137
This commit is contained in:
parent
99018bcb5f
commit
18fd4453d0
|
@ -1281,11 +1281,7 @@ _clone_grad_stops(Eina_List *from)
|
||||||
Efl_Gfx_Gradient_Stop *new_stop;
|
Efl_Gfx_Gradient_Stop *new_stop;
|
||||||
|
|
||||||
new_stop = calloc(1, sizeof(Efl_Gfx_Gradient_Stop));
|
new_stop = calloc(1, sizeof(Efl_Gfx_Gradient_Stop));
|
||||||
new_stop->r = stop->r;
|
memcpy(new_stop, stop, sizeof(Efl_Gfx_Gradient_Stop));
|
||||||
new_stop->g = stop->g;
|
|
||||||
new_stop->b = stop->b;
|
|
||||||
new_stop->a = stop->a;
|
|
||||||
|
|
||||||
res = eina_list_append(res, new_stop);
|
res = eina_list_append(res, new_stop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1308,19 +1304,12 @@ _clone_gradient(Svg_Style_Gradient *from)
|
||||||
if (grad->type == SVG_LINEAR_GRADIENT)
|
if (grad->type == SVG_LINEAR_GRADIENT)
|
||||||
{
|
{
|
||||||
grad->linear = calloc(1, sizeof(Svg_Linear_Gradient));
|
grad->linear = calloc(1, sizeof(Svg_Linear_Gradient));
|
||||||
grad->linear->x1 = from->linear->x1;
|
memcpy(grad->linear, from->linear, sizeof(Svg_Linear_Gradient));
|
||||||
grad->linear->y1 = from->linear->y1;
|
|
||||||
grad->linear->x2 = from->linear->x2;
|
|
||||||
grad->linear->y1 = from->linear->y2;
|
|
||||||
}
|
}
|
||||||
else if (grad->type == SVG_RADIAL_GRADIENT)
|
else if (grad->type == SVG_RADIAL_GRADIENT)
|
||||||
{
|
{
|
||||||
grad->radial = calloc(1, sizeof(Svg_Radial_Gradient));
|
grad->radial = calloc(1, sizeof(Svg_Radial_Gradient));
|
||||||
grad->radial->cx = from->radial->cx;
|
memcpy(grad->radial, from->radial, sizeof(Svg_Radial_Gradient));
|
||||||
grad->radial->cy = from->radial->cy;
|
|
||||||
grad->radial->fx = from->radial->fx;
|
|
||||||
grad->radial->fy = from->radial->fy;
|
|
||||||
grad->radial->r = from->radial->r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return grad;
|
return grad;
|
||||||
|
|
Loading…
Reference in New Issue