_root.render (*draw, context);
}
+#if 0
+ /* debug render area */
+ Rect r = _root.item_to_window (area);
+ context->rectangle (r.x0, r.y0, r.x1 - r.x0, r.y1 - r.y0);
+ context->set_source_rgba (1.0, 0.0, 0.0, 1.0);
+ context->stroke ();
+#endif
}
ostream&
* to be in parent coordinate space since the bounding box of
* an item does not change when moved. If we use
* item->item_to_canvas() on the old bounding box, we will be
+
* using the item's new position, and so will compute the wrong
* invalidation area. If we use the parent (which has not
* moved, then this will work.
*/
-
queue_draw_item_area (item->parent(), pre_change_parent_bounding_box.get ());
}
* we have entered it
*/
- cerr << "E/L: " << items.size() << " to check at " << point << endl;
+ //cerr << "E/L: " << items.size() << " to check at " << point << endl;
#ifdef CANVAS_DEBUG
for (vector<Item const*>::const_reverse_iterator i = items.rbegin(); i != items.rend(); ++i) {
- cerr << '\t' << (*i)->whatami() << ' ' << (*i)->name << " ignore ? " << (*i)->ignore_events() << " current ? " << (_current_item == (*i)) << endl;
+ //cerr << '\t' << (*i)->whatami() << ' ' << (*i)->name << " ignore ? " << (*i)->ignore_events() << " current ? " << (_current_item == (*i)) << endl;
}
#endif
- cerr << "------------\n";
+ //cerr << "------------\n";
for (vector<Item const*>::const_reverse_iterator i = items.rbegin(); i != items.rend(); ++i) {
Item const * new_item = *i;
#ifdef CANVAS_DEBUG
- cerr << "\tE/L check out " << new_item->whatami() << ' ' << new_item->name << " ignore ? " << new_item->ignore_events() << " current ? " << (_current_item == new_item) << endl;
+ //cerr << "\tE/L check out " << new_item->whatami() << ' ' << new_item->name << " ignore ? " << new_item->ignore_events() << " current ? " << (_current_item == new_item) << endl;
#endif
if (new_item->ignore_events()) {
- cerr << "continue1\n";
+ //cerr << "continue1\n";
continue;
}
if (_current_item == new_item) {
- cerr << "continue2\n";
+ //cerr << "continue2\n";
continue;
}
break;
}
- cerr << "Loop around again\n";
+ //cerr << "Loop around again\n";
}
}
if (!(*i)->visible ()) {
#ifdef CANVAS_DEBUG
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
- // cerr << _canvas->render_indent() << "Item " << (*i)->whatami() << " [" << (*i)->name << "] invisible - skipped\n";
+ cerr << _canvas->render_indent() << "Item " << (*i)->whatami() << " [" << (*i)->name << "] invisible - skipped\n";
}
#endif
continue;
#endif
continue;
}
-
+
Rect item = (*i)->item_to_window (item_bbox.get());
+ item.expand (0.5);
boost::optional<Rect> draw = item.intersection (area);
if (draw) {
#ifdef CANVAS_DEBUG
if (DEBUG_ENABLED(PBD::DEBUG::CanvasRender)) {
- cerr << string_compose ("%1render %2 %3 item = %4 intersect = %5\n", _canvas->render_indent(), (*i)->whatami(),
- (*i)->name, item, draw.get());
+ cerr << _canvas->render_indent() << " render "
+ << ' '
+ << (*i)->whatami()
+ << ' '
+ << (*i)->name
+ << " item = "
+ << item
+ << " intersect = "
+ << draw.get()
+ << endl;
}
#endif