rem: if(tb->graphic) { printf("graphic s%d h%d\n", s,tb->sections[s].h);}
add: if(tb->graphic) { printf("DEBUG: graphic s%d h%d\n", s,tb->sections[s].h);}
context: sectionWasSelected(Text *tPtr, TextBlock *tb, XRectangle *rect, int s) {    unsigned short i, w, lw, selected = False, extend = False;    myRect sel;         /* if selection rectangle completely encloses the section */    if ((tb->sections[s]._y >= tPtr->visible.y + tPtr->sel.y)         && (tb->sections[s]._y + tb->sections[s].h             <= tPtr->visible.y + tPtr->sel.y + tPtr->sel.h) ) {         sel.x = 0;        sel.w = tPtr->visible.w;        selected = extend = True;    /* or if it starts on a line and then goes further down */    } else if ((tb->sections[s]._y <= tPtr->visible.y + tPtr->sel.y)         && (tb->sections[s]._y + tb->sections[s].h             <= tPtr->visible.y + tPtr->sel.y + tPtr->sel.h)          && (tb->sections[s]._y + tb->sections[s].h             >= tPtr->visible.y + tPtr->sel.y) ) {         sel.x = WMAX(tPtr->sel.x, tPtr->clicked.x);        sel.w = tPtr->visible.w;        selected = extend = True;    /* or if it begins before a line, but ends on it */    } else if ((tb->sections[s]._y >= tPtr->visible.y + tPtr->sel.y)         && (tb->sections[s]._y + tb->sections[s].h             >= tPtr->visible.y + tPtr->sel.y + tPtr->sel.h)          && (tb->sections[s]._y             <= tPtr->visible.y + tPtr->sel.y + tPtr->sel.h) ) {         if (1||tPtr->sel.x + tPtr->sel.w > tPtr->clicked.x)            sel.w = tPtr->sel.x + tPtr->sel.w;        else             sel.w = tPtr->sel.x;        sel.x = 0;        selected = True;    /* or if the selection rectangle lies entirely within a line */    } else if ((tb->sections[s]._y <= tPtr->visible.y + tPtr->sel.y)         && (tPtr->sel.w >= 2)          && (tb->sections[s]._y + tb->sections[s].h             >= tPtr->visible.y + tPtr->sel.y + tPtr->sel.h) ) {         sel.x = tPtr->sel.x;        sel.w = tPtr->sel.w;        selected = True;    }      if (selected) {         selected = False;               /* if not within (modified) selection rectangle */        if ( tb->sections[s].x > sel.x + sel.w            || tb->sections[s].x + tb->sections[s].w < sel.x)            return False;        if (tb->graphic) {             if ( tb->sections[s].x + tb->sections[s].w <= sel.x + sel.w                 && tb->sections[s].x >= sel.x) {                 rect->width = tb->sections[s].w;                rect->x = tb->sections[s].x;                selected = True;            }        } else {             i = tb->sections[s].begin;             lw = 0;            if (0&& tb->sections[s].x >= sel.x) {                 tb->s_begin = tb->sections[s].begin;                goto _selEnd;            }            while (++i <= tb->sections[s].end) {                w = WMWidthOfString(tb->d.font,  &(tb->text[i-1]), 1);                lw += w;                if (lw + tb->sections[s].x >= sel.x                    || i == tb->sections[s].end ) {                    lw -= w;                    i--;                    tb->s_begin = (tb->selected? WMIN(tb->s_begin, i) : i);                    break;                }            }             if (i > tb->sections[s].end) {                printf("WasSelected: (i > tb->sections[s].end) \n");                return False;            }_selEnd:    rect->x = tb->sections[s].x + lw;            lw = 0;            while(++i <= tb->sections[s].end) {                w = WMWidthOfString(tb->d.font,  &(tb->text[i-1]), 1);                lw += w;                if (lw + rect->x >= sel.x + sel.w                     || i == tb->sections[s].end ) {                    if  (i != tb->sections[s].end) {                         lw -= w;                        i--;                    }                                 rect->width =  lw;                    if (tb->sections[s].last && sel.x + sel.w                        >= tb->sections[s].x + tb->sections[s].w                        && extend ) {                         rect->width  += (tPtr->visible.w - rect->x - lw);                    }                    tb->s_end = (tb->selected? WMAX(tb->s_end, i) : i);                    selected = True;                    break;                 }             }         }     }    if (selected) {         rect->y = tb->sections[s]._y - tPtr->vpos;        rect->height = tb->sections[s].h;if(tb->graphic) { printf("graphic s%d h%d\n", s,tb->sections[s].h);}    }    return selected;}