mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-15 12:34:30 +00:00
common shape: revise Shape::reset() api.
reset Path is useful rather than reset all properties.
This commit is contained in:
parent
9f0fafa5df
commit
8ff1405050
2 changed files with 2 additions and 19 deletions
|
@ -52,7 +52,8 @@ unique_ptr<Shape> Shape::gen() noexcept
|
||||||
|
|
||||||
Result Shape::reset() noexcept
|
Result Shape::reset() noexcept
|
||||||
{
|
{
|
||||||
pImpl->reset();
|
pImpl->path.reset();
|
||||||
|
pImpl->flag = RenderUpdateFlag::Path;
|
||||||
|
|
||||||
return Result::Success;
|
return Result::Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -352,24 +352,6 @@ struct Shape::Impl
|
||||||
return true;
|
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()
|
Paint* duplicate()
|
||||||
{
|
{
|
||||||
auto ret = Shape::gen();
|
auto ret = Shape::gen();
|
||||||
|
|
Loading…
Add table
Reference in a new issue