mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
do not sort lineset every time a coord is added; use RAII to create scope and sort at end
This commit is contained in:
parent
d4bca18108
commit
4f87506e5c
4 changed files with 29 additions and 9 deletions
|
|
@ -131,12 +131,23 @@ LineSet::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
|
|||
}
|
||||
|
||||
void
|
||||
LineSet::add_coord (Coord y, Distance width, Gtkmm2ext::Color color)
|
||||
LineSet::add_coord (Coord pos, Distance width, Gtkmm2ext::Color color)
|
||||
{
|
||||
_lines.push_back (Line (pos, width, color));
|
||||
}
|
||||
|
||||
void
|
||||
LineSet::begin_add ()
|
||||
{
|
||||
begin_change ();
|
||||
}
|
||||
|
||||
_lines.push_back (Line (y, width, color));
|
||||
sort (_lines.begin(), _lines.end(), LineSorter());
|
||||
void
|
||||
LineSet::end_add ()
|
||||
{
|
||||
if (!_lines.empty()) {
|
||||
sort (_lines.begin(), _lines.end(), LineSorter());
|
||||
}
|
||||
|
||||
set_bbox_dirty ();
|
||||
end_change ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue