mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
auto-fication of a loop in Canvas::Item plus some variable renaming
This commit is contained in:
parent
0fc28d3872
commit
922b961672
1 changed files with 15 additions and 16 deletions
|
|
@ -893,48 +893,47 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
|
||||||
|
|
||||||
++render_depth;
|
++render_depth;
|
||||||
|
|
||||||
for (std::vector<Item*>::const_iterator i = items.begin(); i != items.end(); ++i) {
|
for (auto const & item : items) {
|
||||||
|
|
||||||
if (!(*i)->visible ()) {
|
if (!item->visible ()) {
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
cerr << _canvas->render_indent() << "Item " << (*i)->whoami() << " invisible - skipped\n";
|
cerr << _canvas->render_indent() << "Item " << item->whoami() << " invisible - skipped\n";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect item_bbox = (*i)->bounding_box ();
|
Rect item_bbox = item->bounding_box ();
|
||||||
|
|
||||||
if (!item_bbox) {
|
if (!item_bbox) {
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
cerr << _canvas->render_indent() << "Item " << (*i)->whoami() << " empty - skipped\n";
|
cerr << _canvas->render_indent() << "Item " << item->whoami() << " empty - skipped\n";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect item = (*i)->item_to_window (item_bbox, false);
|
Rect window_bbox = item->item_to_window (item_bbox, false);
|
||||||
Rect d = item.intersection (area);
|
Rect d = window_bbox.intersection (area);
|
||||||
|
|
||||||
if (d) {
|
if (d) {
|
||||||
Rect draw = d;
|
if (d.width() && d.height()) {
|
||||||
if (draw.width() && draw.height()) {
|
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
if (dynamic_cast<Container*>(*i) == 0) {
|
if (!dynamic_cast<Container*> (item)) {
|
||||||
cerr << _canvas->render_indent() << "render "
|
cerr << _canvas->render_indent() << "render "
|
||||||
<< ' '
|
<< ' '
|
||||||
<< (*i)
|
<< area
|
||||||
<< ' '
|
<< ' '
|
||||||
<< (*i)->whoami()
|
<< item->whoami()
|
||||||
<< " item "
|
<< " item "
|
||||||
<< item_bbox
|
<< item_bbox
|
||||||
<< " window = "
|
<< " window = "
|
||||||
<< item
|
<< window_bbox
|
||||||
<< " intersect = "
|
<< " intersect = "
|
||||||
<< draw
|
<< d
|
||||||
<< " @ "
|
<< " @ "
|
||||||
<< _position
|
<< _position
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
@ -944,7 +943,7 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
|
||||||
if (_canvas->item_save_restore) {
|
if (_canvas->item_save_restore) {
|
||||||
context->save();
|
context->save();
|
||||||
}
|
}
|
||||||
(*i)->render (area, context);
|
item->render (area, context);
|
||||||
if (_canvas->item_save_restore) {
|
if (_canvas->item_save_restore) {
|
||||||
context->restore();
|
context->restore();
|
||||||
}
|
}
|
||||||
|
|
@ -955,7 +954,7 @@ Item::render_children (Rect const & area, Cairo::RefPtr<Cairo::Context> context)
|
||||||
|
|
||||||
#ifdef CANVAS_DEBUG
|
#ifdef CANVAS_DEBUG
|
||||||
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
if (_canvas->debug_render() || DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
|
||||||
cerr << string_compose ("%1skip render of %2, no intersection between %3 and %4\n", _canvas->render_indent(), (*i)->whoami(), item, area);
|
cerr << string_compose ("%1skip render of %2, no intersection between %3 and %4\n", _canvas->render_indent(), item->whoami(), item, area);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue