mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-03 12:19:33 +01:00
add Group::clear(), do not clear _canvas member of Item when unparented (only the parent is changed)
This commit is contained in:
parent
fee8de9787
commit
fca81c9a6a
5 changed files with 67 additions and 171 deletions
|
|
@ -170,6 +170,8 @@ Group::compute_bounding_box () const
|
|||
void
|
||||
Group::add (Item* i)
|
||||
{
|
||||
/* XXX should really notify canvas about this */
|
||||
|
||||
_items.push_back (i);
|
||||
invalidate_lut ();
|
||||
_bounding_box_dirty = true;
|
||||
|
|
@ -180,11 +182,40 @@ Group::add (Item* i)
|
|||
void
|
||||
Group::remove (Item* i)
|
||||
{
|
||||
|
||||
if (i->parent() != this) {
|
||||
return;
|
||||
}
|
||||
|
||||
begin_change ();
|
||||
|
||||
i->unparent ();
|
||||
_items.remove (i);
|
||||
invalidate_lut ();
|
||||
_bounding_box_dirty = true;
|
||||
|
||||
DEBUG_TRACE (PBD::DEBUG::CanvasItemsDirtied, "canvas item dirty: group remove\n");
|
||||
end_change ();
|
||||
}
|
||||
|
||||
void
|
||||
Group::clear (bool with_delete)
|
||||
{
|
||||
begin_change ();
|
||||
|
||||
for (list<Item*>::iterator i = _items.begin(); i != _items.end(); ++i) {
|
||||
if (with_delete) {
|
||||
delete *i;
|
||||
} else {
|
||||
(*i)->unparent ();
|
||||
}
|
||||
}
|
||||
|
||||
_items.clear ();
|
||||
|
||||
invalidate_lut ();
|
||||
_bounding_box_dirty = true;
|
||||
|
||||
end_change ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue