mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
shape: Refactoring to use initialize list
Member data should be initialized in-class or in a constructor initialization list
This commit is contained in:
parent
c819754056
commit
69f02d803b
1 changed files with 4 additions and 4 deletions
|
@ -41,11 +41,11 @@ struct ShapeStroke
|
||||||
ShapeStroke() {}
|
ShapeStroke() {}
|
||||||
|
|
||||||
ShapeStroke(const ShapeStroke* src)
|
ShapeStroke(const ShapeStroke* src)
|
||||||
|
: width(src->width),
|
||||||
|
dashCnt(src->dashCnt),
|
||||||
|
cap(src->cap),
|
||||||
|
join(src->join)
|
||||||
{
|
{
|
||||||
width = src->width;
|
|
||||||
dashCnt = src->dashCnt;
|
|
||||||
cap = src->cap;
|
|
||||||
join = src->join;
|
|
||||||
memcpy(color, src->color, sizeof(color));
|
memcpy(color, src->color, sizeof(color));
|
||||||
dashPattern = static_cast<float*>(malloc(sizeof(float) * dashCnt));
|
dashPattern = static_cast<float*>(malloc(sizeof(float) * dashCnt));
|
||||||
memcpy(dashPattern, src->dashPattern, sizeof(float) * dashCnt);
|
memcpy(dashPattern, src->dashPattern, sizeof(float) * dashCnt);
|
||||||
|
|
Loading…
Add table
Reference in a new issue