common shape: revise Shape::reset() api.

reset Path is useful rather than reset all properties.
This commit is contained in:
Hermet Park 2021-03-12 18:00:47 +09:00 committed by Hermet Park
parent 9f0fafa5df
commit 8ff1405050
2 changed files with 2 additions and 19 deletions

View file

@ -52,7 +52,8 @@ unique_ptr<Shape> Shape::gen() noexcept
Result Shape::reset() noexcept
{
pImpl->reset();
pImpl->path.reset();
pImpl->flag = RenderUpdateFlag::Path;
return Result::Success;
}

View file

@ -352,24 +352,6 @@ struct Shape::Impl
return true;
}
void reset()
{
path.reset();
if (fill) {
delete(fill);
fill = nullptr;
}
if (stroke) {
delete(stroke);
stroke = nullptr;
}
color[0] = color[1] = color[2] = color[3] = 0;
flag = RenderUpdateFlag::All;
}
Paint* duplicate()
{
auto ret = Shape::gen();