ROOT logo
// @(#)root/gui:$Id$
// Author: Fons Rademakers   02/01/98

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
/**************************************************************************

    This source is based on Xclass95, a Win95-looking GUI toolkit.
    Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.

    Xclass95 is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

**************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGDimension, TGPosition, TGLongPosition, TGInsets and TGRectangle    //
//                                                                      //
// Several small geometry classes that implement dimensions             //
// (width and height), positions (x and y), insets and rectangles.      //
// They are trivial and their members are public.                       //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TGDimension.h"
#include "TMathBase.h"

ClassImp(TGDimension)
ClassImp(TGPosition)
ClassImp(TGLongPosition)
ClassImp(TGInsets)
ClassImp(TGRectangle)

void TGRectangle::Merge(const TGRectangle &r)
{ 
   // Merge parameters
   Int_t max_x = TMath::Max(fX + (Int_t) fW, r.fX + (Int_t) r.fW); 
   fX = TMath::Min(fX, r.fX);
   Int_t max_y = TMath::Max(fY + (Int_t) fH, r.fY + (Int_t) r.fH); 
   fY = TMath::Min(fY, r.fY);
   fW = max_x - fX;
   fH = max_y - fY; 
}
 TGDimension.cxx:1
 TGDimension.cxx:2
 TGDimension.cxx:3
 TGDimension.cxx:4
 TGDimension.cxx:5
 TGDimension.cxx:6
 TGDimension.cxx:7
 TGDimension.cxx:8
 TGDimension.cxx:9
 TGDimension.cxx:10
 TGDimension.cxx:11
 TGDimension.cxx:12
 TGDimension.cxx:13
 TGDimension.cxx:14
 TGDimension.cxx:15
 TGDimension.cxx:16
 TGDimension.cxx:17
 TGDimension.cxx:18
 TGDimension.cxx:19
 TGDimension.cxx:20
 TGDimension.cxx:21
 TGDimension.cxx:22
 TGDimension.cxx:23
 TGDimension.cxx:24
 TGDimension.cxx:25
 TGDimension.cxx:26
 TGDimension.cxx:27
 TGDimension.cxx:28
 TGDimension.cxx:29
 TGDimension.cxx:30
 TGDimension.cxx:31
 TGDimension.cxx:32
 TGDimension.cxx:33
 TGDimension.cxx:34
 TGDimension.cxx:35
 TGDimension.cxx:36
 TGDimension.cxx:37
 TGDimension.cxx:38
 TGDimension.cxx:39
 TGDimension.cxx:40
 TGDimension.cxx:41
 TGDimension.cxx:42
 TGDimension.cxx:43
 TGDimension.cxx:44
 TGDimension.cxx:45
 TGDimension.cxx:46
 TGDimension.cxx:47
 TGDimension.cxx:48
 TGDimension.cxx:49
 TGDimension.cxx:50
 TGDimension.cxx:51