static int fitsinside(fz_node *node, fz_rect clip) { fz_rect bbox; bbox = fz_boundnode(node, fz_identity()); if (fz_isinfiniterect(bbox)) return 0; if (fz_isemptyrect(bbox)) return 1; if (bbox.x0 < clip.x0) return 0; if (bbox.x1 > clip.x1) return 0; if (bbox.y0 < clip.y0) return 0; if (bbox.y1 > clip.y1) return 0; return 1; }
bool isInsideRect( fz_rect maxRect, fz_rect checkRect ) { if (fz_isinfiniterect(checkRect) || fz_isemptyrect(checkRect)) return true; return ((maxRect.x0 <= checkRect.x0) && (maxRect.y0 <= checkRect.y0) && (maxRect.x1 >= checkRect.x1) && (maxRect.y1 >= checkRect.y1)); }
void fz_resetgel(fz_gel *gel, fz_bbox clip) { if (fz_isinfiniterect(clip)) { gel->clip.x0 = gel->clip.y0 = BBOX_MAX; gel->clip.x1 = gel->clip.y1 = BBOX_MIN; } else { gel->clip.x0 = clip.x0 * HSCALE; gel->clip.x1 = clip.x1 * HSCALE; gel->clip.y0 = clip.y0 * VSCALE; gel->clip.y1 = clip.y1 * VSCALE; } gel->bbox.x0 = gel->bbox.y0 = BBOX_MAX; gel->bbox.x1 = gel->bbox.y1 = BBOX_MIN; gel->len = 0; }