ROOT   Reference Guide
TGDimension.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 02/01/98
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. * 9 * For the list of contributors see$ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11/**************************************************************************
12
13 This source is based on Xclass95, a Win95-looking GUI toolkit.
14 Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15
16 Xclass95 is free software; you can redistribute it and/or
17 modify it under the terms of the GNU Library General Public
18 License as published by the Free Software Foundation; either
19 version 2 of the License, or (at your option) any later version.
20
21**************************************************************************/
22
23
24/**
25\defgroup guigeom GUI Geometry
26\ingroup guiwidgets
27
28Several small geometry classes that implement dimensions
29(width and height), positions (x and y), insets and rectangles.
30They are trivial and their members are public.
31
32\class TGDimension
33\ingroup guigeom
34\class TGPosition
35\ingroup guigeom
36\class TGLongPosition
37\ingroup guigeom
38\class TGInsets
39\ingroup guigeom
40\class TGRectangle
41\ingroup guigeom
42
43*/
44
45
46#include "TGDimension.h"
47#include "TMathBase.h"
48
50{
51 // Merge parameters
52 Int_t max_x = TMath::Max(fX + (Int_t) fW, r.fX + (Int_t) r.fW);
53 fX = TMath::Min(fX, r.fX);
54 Int_t max_y = TMath::Max(fY + (Int_t) fH, r.fY + (Int_t) r.fH);
55 fY = TMath::Min(fY, r.fY);
56 fW = max_x - fX;
57 fH = max_y - fY;
58}
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
UInt_t fH
height
Definition: TGDimension.h:94
UInt_t fW
width
Definition: TGDimension.h:93
Int_t fX
x position
Definition: TGDimension.h:91
void Merge(const TGRectangle &r)
Definition: TGDimension.cxx:49
Int_t fY
y position
Definition: TGDimension.h:92
SCoord_t fY
Definition: TPoint.h:36
SCoord_t fX
Definition: TPoint.h:35
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition: TMathBase.h:250
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Definition: TMathBase.h:198