rem: if(*nitems >= MAX_CHUNX) { items[*nitems].chars = 0; items[*nitems].x = *Lmargin+where->x; items[*nitems].chunk = chunk; items[*nitems].start = 0; where->y += myDrawText(tPtr, para, items, *nitems+1, p_width-*Lmargin, where->y, draw, 0); if(tPtr->findingClickPoint && tPtr->foundClickPoint) return; *nitems = 0; where->x = 0; } else { (*nitems)++; where->x += chunk->pixmap->width; } } else if(chunk->pixmap->width <= p_width - *Lmargin) {  where->y += myDrawText(tPtr, para, items, *nitems+1, p_width-*Lmargin, where->y, draw, 0); *nitems = 0; *Lmargin = WMAX(0, m.body - m.first); where->x = 0; drawPChunkPart(tPtr, chunk, m, para, items, nitems, Lmargin, where, draw);
add: return; if (where->x + chunk->pixmap->width <= p_width - *Lmargin) {  items[*nitems].pix = chunk->pixmap; items[*nitems].type = ctImage; items[*nitems].chars = 0; items[*nitems].x = *Lmargin + where->x; items[*nitems].chunk = chunk; items[*nitems].start = 0;  if (*nitems >= MAX_CHUNX) { items[*nitems].chars = 0; items[*nitems].x = *Lmargin + where->x; items[*nitems].chunk = chunk; items[*nitems].start = 0; where->y += myDrawText(tPtr, para, items, *nitems + 1, p_width - *Lmargin, where->y, draw, 0); if (tPtr->findingClickPoint && tPtr->foundClickPoint) return; *nitems = 0; where->x = 0; } else { (*nitems)++; where->x += chunk->pixmap->width; } } else if (chunk->pixmap->width <= p_width - *Lmargin) {  where->y += myDrawText(tPtr, para, items, *nitems + 1, p_width - *Lmargin, where->y, draw, 0); *nitems = 0; *Lmargin = WMAX(0, m.body - m.first); where->x = 0; drawPChunkPart(tPtr, chunk, m, para, items, nitems, Lmargin, where, draw);
context: drawPChunkPart(Text *tPtr, Chunk *chunk, LocalMargins m, Paragraph *para,               MyTextItems *items, short *nitems, short *Lmargin, XPoint *where, short draw){    short p_width;    if(!chunk) return;    if(!chunk->pixmap)        chunk->pixmap = WMRetainPixmap(tPtr->dUnknownImg);    p_width = m.right - WMIN(m.first, m.body) - WMGetRulerOffset(tPtr->ruler);    if(p_width < MIN_DOC_WIDTH) // need WMRuler to take care of this...        return;    if(where->x + chunk->pixmap->width <= p_width - *Lmargin) {        /* it can fit on rest of line */        items[*nitems].pix = chunk->pixmap;        items[*nitems].type = ctImage;        items[*nitems].chars = 0;        items[*nitems].x = *Lmargin+where->x;        items[*nitems].chunk = chunk;        items[*nitems].start = 0;        if(*nitems >= MAX_CHUNX) {            items[*nitems].chars = 0;            items[*nitems].x = *Lmargin+where->x;            items[*nitems].chunk = chunk;            items[*nitems].start = 0;            where->y += myDrawText(tPtr, para, items, *nitems+1,                                   p_width-*Lmargin, where->y, draw, 0);            if(tPtr->findingClickPoint && tPtr->foundClickPoint) return;            *nitems = 0;            where->x = 0;        } else {            (*nitems)++;            where->x += chunk->pixmap->width;        }    } else if(chunk->pixmap->width <= p_width - *Lmargin) {        /* it can fit on an entire line, flush the myDrawText then wrap it */        where->y += myDrawText(tPtr, para, items, *nitems+1,                               p_width-*Lmargin, where->y, draw, 0);        *nitems = 0;        *Lmargin = WMAX(0, m.body - m.first);        where->x = 0;        drawPChunkPart(tPtr, chunk, m, para, items, nitems,                       Lmargin, where, draw);    } else {#if 1        *nitems = 0;        where->x = 0;        *Lmargin = WMAX(0, m.body - m.first);        items[*nitems].pix = chunk->pixmap;        items[*nitems].type = ctImage;        items[*nitems].chars = 0;        items[*nitems].x = *Lmargin+where->x;        items[*nitems].chunk = chunk;        items[*nitems].start = 0;        where->y += myDrawText(tPtr, para, items, *nitems+1,                               p_width-*Lmargin, where->y, draw, 0);#endif        /* scale image to fit, call self again */        /* deprecated - the management */    }}