Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

int GRect::recthull ( const GRect rect1,
const GRect rect2 
)

Sets the rectangle to the smallest rectangle containing the points of both rectangles rect1# and rect2#. This function returns true if the created rectangle is not empty.

Definition at line 163 of file GRect.cpp.

References isempty(), xmax, xmin, ymax, and ymin.

{
  if (rect1.isempty())
    {
      xmin = rect2.xmin;
      xmax = rect2.xmax;
      ymin = rect2.ymin;
      ymax = rect2.ymax;
      return !isempty();
    }
  if (rect2.isempty())
    {
      xmin = rect1.xmin;
      xmax = rect1.xmax;
      ymin = rect1.ymin;
      ymax = rect1.ymax;
      return !isempty();
    }
  xmin = imin(rect1.xmin, rect2.xmin);
  xmax = imax(rect1.xmax, rect2.xmax);
  ymin = imin(rect1.ymin, rect2.ymin);
  ymax = imax(rect1.ymax, rect2.ymax);
  return 1;
}


Generated by  Doxygen 1.6.0   Back to index