mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 09:36:33 +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,9 +170,11 @@ Canvas::item_shown_or_hidden (Item* item)
|
||||||
{
|
{
|
||||||
boost::optional<Rect> bbox = item->bounding_box ();
|
boost::optional<Rect> bbox = item->bounding_box ();
|
||||||
if (bbox) {
|
if (bbox) {
|
||||||
|
if (item->item_to_window (*bbox).intersection (visible_area ())) {
|
||||||
queue_draw_item_area (item, bbox.get ());
|
queue_draw_item_area (item, bbox.get ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Called when an item has a change to its visual properties
|
/** Called when an item has a change to its visual properties
|
||||||
* that do NOT affect its bounding box.
|
* that do NOT affect its bounding box.
|
||||||
|
|
@ -183,9 +185,11 @@ Canvas::item_visual_property_changed (Item* item)
|
||||||
{
|
{
|
||||||
boost::optional<Rect> bbox = item->bounding_box ();
|
boost::optional<Rect> bbox = item->bounding_box ();
|
||||||
if (bbox) {
|
if (bbox) {
|
||||||
|
if (item->item_to_window (*bbox).intersection (visible_area ())) {
|
||||||
queue_draw_item_area (item, bbox.get ());
|
queue_draw_item_area (item, bbox.get ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Called when an item has changed, but not moved.
|
/** Called when an item has changed, but not moved.
|
||||||
* @param item Item that has changed.
|
* @param item Item that has changed.
|
||||||
|
|
@ -195,17 +199,26 @@ Canvas::item_visual_property_changed (Item* item)
|
||||||
void
|
void
|
||||||
Canvas::item_changed (Item* item, boost::optional<Rect> pre_change_bounding_box)
|
Canvas::item_changed (Item* item, boost::optional<Rect> pre_change_bounding_box)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Rect window_bbox = visible_area ();
|
||||||
|
|
||||||
if (pre_change_bounding_box) {
|
if (pre_change_bounding_box) {
|
||||||
|
|
||||||
|
if (item->item_to_window (*pre_change_bounding_box).intersection (window_bbox)) {
|
||||||
/* request a redraw of the item's old bounding box */
|
/* request a redraw of the item's old bounding box */
|
||||||
queue_draw_item_area (item, pre_change_bounding_box.get ());
|
queue_draw_item_area (item, pre_change_bounding_box.get ());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boost::optional<Rect> post_change_bounding_box = item->bounding_box ();
|
boost::optional<Rect> post_change_bounding_box = item->bounding_box ();
|
||||||
if (post_change_bounding_box) {
|
if (post_change_bounding_box) {
|
||||||
|
|
||||||
|
if (item->item_to_window (*post_change_bounding_box).intersection (window_bbox)) {
|
||||||
/* request a redraw of the item's new bounding box */
|
/* request a redraw of the item's new bounding box */
|
||||||
queue_draw_item_area (item, post_change_bounding_box.get ());
|
queue_draw_item_area (item, post_change_bounding_box.get ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Duple
|
Duple
|
||||||
Canvas::window_to_canvas (Duple const & d) const
|
Canvas::window_to_canvas (Duple const & d) const
|
||||||
|
|
|
||||||
|
|
@ -545,12 +545,14 @@ Item::begin_change ()
|
||||||
void
|
void
|
||||||
Item::end_change ()
|
Item::end_change ()
|
||||||
{
|
{
|
||||||
|
if (_visible) {
|
||||||
_canvas->item_changed (this, _pre_change_bounding_box);
|
_canvas->item_changed (this, _pre_change_bounding_box);
|
||||||
|
|
||||||
if (_parent) {
|
if (_parent) {
|
||||||
_parent->child_changed ();
|
_parent->child_changed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Item::begin_visual_change ()
|
Item::begin_visual_change ()
|
||||||
|
|
@ -560,8 +562,10 @@ Item::begin_visual_change ()
|
||||||
void
|
void
|
||||||
Item::end_visual_change ()
|
Item::end_visual_change ()
|
||||||
{
|
{
|
||||||
|
if (_visible) {
|
||||||
_canvas->item_visual_property_changed (this);
|
_canvas->item_visual_property_changed (this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Item::move (Duple movement)
|
Item::move (Duple movement)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue