Minor cleanup to 6110fb5
This commit is contained in:
parent
7b85d7b113
commit
9c15e54baf
1 changed files with 4 additions and 8 deletions
|
@ -1494,16 +1494,12 @@ void canvas::parse_cfg(const config& cfg)
|
|||
|
||||
void canvas::clear_shapes(const bool force)
|
||||
{
|
||||
auto iter = std::remove_if(shapes_.begin(), shapes_.end(), [force](const shape_ptr s)
|
||||
{
|
||||
return !s->immutable() && !force;
|
||||
});
|
||||
auto conditional = [force](const shape_ptr s)->bool { return !s->immutable() && !force; };
|
||||
|
||||
auto iter = std::remove_if(shapes_.begin(), shapes_.end(), conditional);
|
||||
shapes_.erase(iter, shapes_.end());
|
||||
|
||||
iter = std::remove_if(drawn_shapes_.begin(), drawn_shapes_.end(), [force](const shape_ptr s)
|
||||
{
|
||||
return !s->immutable() && !force;
|
||||
});
|
||||
iter = std::remove_if(drawn_shapes_.begin(), drawn_shapes_.end(), conditional);
|
||||
drawn_shapes_.erase(iter, drawn_shapes_.end());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue