mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
Merge branch 'canvas_tweaks' of https://github.com/nmains/ardour into cairocanvas
This commit is contained in:
commit
36a34dc1a4
2 changed files with 27 additions and 10 deletions
|
|
@ -170,7 +170,9 @@ Canvas::item_shown_or_hidden (Item* item)
|
|||
{
|
||||
boost::optional<Rect> bbox = item->bounding_box ();
|
||||
if (bbox) {
|
||||
queue_draw_item_area (item, bbox.get ());
|
||||
if (item->item_to_window (*bbox).intersection (visible_area ())) {
|
||||
queue_draw_item_area (item, bbox.get ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +185,9 @@ Canvas::item_visual_property_changed (Item* item)
|
|||
{
|
||||
boost::optional<Rect> bbox = item->bounding_box ();
|
||||
if (bbox) {
|
||||
queue_draw_item_area (item, bbox.get ());
|
||||
if (item->item_to_window (*bbox).intersection (visible_area ())) {
|
||||
queue_draw_item_area (item, bbox.get ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -195,15 +199,24 @@ Canvas::item_visual_property_changed (Item* item)
|
|||
void
|
||||
Canvas::item_changed (Item* item, boost::optional<Rect> pre_change_bounding_box)
|
||||
{
|
||||
|
||||
Rect window_bbox = visible_area ();
|
||||
|
||||
if (pre_change_bounding_box) {
|
||||
/* request a redraw of the item's old bounding box */
|
||||
queue_draw_item_area (item, pre_change_bounding_box.get ());
|
||||
|
||||
if (item->item_to_window (*pre_change_bounding_box).intersection (window_bbox)) {
|
||||
/* request a redraw of the item's old bounding box */
|
||||
queue_draw_item_area (item, pre_change_bounding_box.get ());
|
||||
}
|
||||
}
|
||||
|
||||
boost::optional<Rect> post_change_bounding_box = item->bounding_box ();
|
||||
if (post_change_bounding_box) {
|
||||
/* request a redraw of the item's new bounding box */
|
||||
queue_draw_item_area (item, post_change_bounding_box.get ());
|
||||
|
||||
if (item->item_to_window (*post_change_bounding_box).intersection (window_bbox)) {
|
||||
/* request a redraw of the item's new bounding box */
|
||||
queue_draw_item_area (item, post_change_bounding_box.get ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue