diff options
author | Sebastian Geerken <devnull@localhost> | 2015-01-23 14:39:17 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-01-23 14:39:17 +0100 |
commit | 157c44928d2d4d08ba9f18742290bdd6ba229d12 (patch) | |
tree | 783b596646529aaee7de24413cf2354fe9ee5600 /dw/widget.cc | |
parent | 80229b2b5159af52b407fdf2f535d57c669bb667 (diff) |
Interrupted drawing: cleanups, comments, documentation.
Diffstat (limited to 'dw/widget.cc')
-rw-r--r-- | dw/widget.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/dw/widget.cc b/dw/widget.cc index 2197e6d1..9188f997 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -122,11 +122,13 @@ Widget::~Widget () /** - * \brief Calculates the intersection of widget->allocation and area, returned - * in intersection (in widget coordinates!). + * \brief Calculates the intersection of the visible allocation + * (i. e. the intersection with the visible parent allocation) and + * "area" (in widget coordinates referring to "refWidget"), + * returned in intersection (in widget coordinates). * - * Typically used by containers when drawing their children. Returns whether - * intersection is not empty. + * Typically used by containers when drawing their children (passing + * "this" as "refWidget"). Returns whether intersection is not empty. */ bool Widget::intersects (Widget *refWidget, Rectangle *area, Rectangle *intersection) @@ -141,7 +143,9 @@ bool Widget::intersects (Widget *refWidget, Rectangle *area, intersection->y += refWidget->allocation.y; r = true; - for (Widget *widget = this; r && widget != refWidget->parent; + // "RefWidget" is excluded; it is assumed that "area" its already within + // its allocation. + for (Widget *widget = this; r && widget != refWidget; widget = widget->parent) { assert (widget != NULL); // refWidget must be ancestor. @@ -186,6 +190,9 @@ bool Widget::intersects (Widget *refWidget, Rectangle *area, return r; } +/** + * See \ref dw-interrupted-drawing for details. + */ void Widget::drawInterruption (View *view, Rectangle *area, DrawingContext *context) { |