添加MaterialStyleStroke的拷贝构造

TaoZhang-Branch
wuyize 2023-03-10 16:04:29 +08:00
parent 15e2522591
commit 520597e288
2 changed files with 7 additions and 0 deletions

View File

@ -70,6 +70,12 @@ Renderer::MaterialStyleStroke::MaterialStyleStroke(float width, StrokeType strok
{ {
} }
Renderer::MaterialStyleStroke::MaterialStyleStroke(const MaterialStyleStroke& s)
:halfWidth(s.halfWidth), strokeType(s.strokeType), endType(s.endType), materialStroke(std::make_shared<MaterialStroke>(*s.materialStroke))
{
}
MaterialStyleType Renderer::MaterialStyleStroke::type() const MaterialStyleType Renderer::MaterialStyleStroke::type() const
{ {
return MaterialStyleType::kStroke; return MaterialStyleType::kStroke;

View File

@ -45,6 +45,7 @@ namespace Renderer
{ {
public: public:
MaterialStyleStroke(float width, StrokeType strokeType, StrokeEndType endType, std::shared_ptr<MaterialStroke> materialStroke); MaterialStyleStroke(float width, StrokeType strokeType, StrokeEndType endType, std::shared_ptr<MaterialStroke> materialStroke);
MaterialStyleStroke(const MaterialStyleStroke&);
virtual MaterialStyleType type() const override; virtual MaterialStyleType type() const override;
virtual std::vector<GLfloat> encoded() const override; virtual std::vector<GLfloat> encoded() const override;
virtual bool operator==(const MaterialStyle&) const override; virtual bool operator==(const MaterialStyle&) const override;