shape: Refactoring to use initialize list

Member data should be initialized in-class or in a constructor initialization list
This commit is contained in:
JunsuChoi 2021-02-19 16:12:11 +09:00 committed by Hermet Park
parent c819754056
commit 69f02d803b

View file

@ -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);