canvas: add PolyItem::clear()

This commit is contained in:
Paul Davis 2023-09-30 10:53:52 -06:00
parent ff021b83d3
commit cd99fed7cd
2 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,7 @@ public:
virtual void set (Points const&);
virtual void add_point (Duple const &);
virtual void clear ();
void pop_back();
Points const& get () const;

View File

@ -158,6 +158,17 @@ PolyItem::pop_back ()
end_change ();
}
void
PolyItem::clear ()
{
if (!_points.empty()) {
begin_change ();
_points.clear ();
set_bbox_dirty ();
end_change ();
}
}
Points const&
PolyItem::get () const
{