mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-01 19:37:45 +01:00
don't queue redraws when various canvas item properties are "reset" to the same value, plus supporting functions
This commit is contained in:
parent
495c0de4ac
commit
c2946ee00f
7 changed files with 131 additions and 107 deletions
|
|
@ -139,82 +139,77 @@ Rectangle::set (Rect const & r)
|
|||
/* We don't update the bounding box here; it's just
|
||||
as cheap to do it when asked.
|
||||
*/
|
||||
|
||||
begin_change ();
|
||||
|
||||
_rect = r;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
|
||||
DEBUG_TRACE (PBD::DEBUG::CanvasItemsDirtied, "canvas item dirty: rectangle change (set)\n");
|
||||
if (r != _rect) {
|
||||
|
||||
begin_change ();
|
||||
|
||||
_rect = r;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Rectangle::set_x0 (Coord x0)
|
||||
{
|
||||
begin_change ();
|
||||
|
||||
_rect.x0 = x0;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
|
||||
DEBUG_TRACE (PBD::DEBUG::CanvasItemsDirtied, "canvas item dirty: rectangle change (x0)\n");
|
||||
if (x0 != _rect.x0) {
|
||||
begin_change ();
|
||||
|
||||
_rect.x0 = x0;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Rectangle::set_y0 (Coord y0)
|
||||
{
|
||||
begin_change ();
|
||||
|
||||
_rect.y0 = y0;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change();
|
||||
|
||||
DEBUG_TRACE (PBD::DEBUG::CanvasItemsDirtied, "canvas item dirty: rectangle change (y0)\n");
|
||||
if (y0 != _rect.y0) {
|
||||
begin_change ();
|
||||
|
||||
_rect.y0 = y0;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Rectangle::set_x1 (Coord x1)
|
||||
{
|
||||
begin_change ();
|
||||
|
||||
_rect.x1 = x1;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
|
||||
DEBUG_TRACE (PBD::DEBUG::CanvasItemsDirtied, "canvas item dirty: rectangle change (x1)\n");
|
||||
if (x1 != _rect.x1) {
|
||||
begin_change ();
|
||||
|
||||
_rect.x1 = x1;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Rectangle::set_y1 (Coord y1)
|
||||
{
|
||||
begin_change ();
|
||||
|
||||
_rect.y1 = y1;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
|
||||
DEBUG_TRACE (PBD::DEBUG::CanvasItemsDirtied, "canvas item dirty: rectangle change (y1)\n");
|
||||
if (y1 != _rect.y1) {
|
||||
begin_change ();
|
||||
|
||||
_rect.y1 = y1;
|
||||
|
||||
_bounding_box_dirty = true;
|
||||
end_change ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Rectangle::set_outline_what (What what)
|
||||
{
|
||||
begin_change ();
|
||||
|
||||
_outline_what = what;
|
||||
|
||||
end_change ();
|
||||
}
|
||||
|
||||
void
|
||||
Rectangle::set_outline_what (int what)
|
||||
{
|
||||
set_outline_what ((What) what);
|
||||
if (what != _outline_what) {
|
||||
begin_visual_change ();
|
||||
_outline_what = what;
|
||||
end_visual_change ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue