_root.render (*draw, context);
-#if 0
- // This transparently colors the rect being rendered, after it has been drawn.
- double r = (random() % 65536) /65536.0;
- double g = (random() % 65536) /65536.0;
- double b = (random() % 65536) /65536.0;
- context->rectangle (draw->x0, draw->y0, draw->x1 - draw->x0, draw->y1 - draw->y0);
- context->set_source_rgba (r, g, b, 0.25);
- context->fill ();
+#ifdef CANVAS_DEBUG
+ if (getenv ("CANVAS_HARLEQUIN_DEBUGGING")) {
+ // This transparently colors the rect being rendered, after it has been drawn.
+ double r = (random() % 65536) /65536.0;
+ double g = (random() % 65536) /65536.0;
+ double b = (random() % 65536) /65536.0;
+ context->rectangle (draw->x0, draw->y0, draw->x1 - draw->x0, draw->y1 - draw->y0);
+ context->set_source_rgba (r, g, b, 0.25);
+ context->fill ();
+ }
#endif
-
}
}
std::list<Item*> const& root_children (_root.items());
ScrollGroup* sg = 0;
+ /* if the coordinates are negative, clamp to zero and find the item
+ * that covers that "edge" position.
+ */
+
+ Duple in_window (d);
+
+ if (in_window.x < 0) {
+ in_window.x = 0;
+ }
+ if (in_window.y < 0) {
+ in_window.y = 0;
+ }
+
for (std::list<Item*>::const_iterator i = root_children.begin(); i != root_children.end(); ++i) {
- if (((sg = dynamic_cast<ScrollGroup*>(*i)) != 0) && sg->covers_window (d)) {
+ if (((sg = dynamic_cast<ScrollGroup*>(*i)) != 0) && sg->covers_window (in_window)) {
break;
}
}