OpenTTD Source: src/core/geometry_func.cpp File Reference

OpenTTD Source 14.0-beta3

Functions
geometry_func.cpp File Reference
`#include "../stdafx.h"`
`#include "geometry_func.hpp"`
`#include "math_func.hpp"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Functions
Dimension | maxdim (const Dimension &d1, const Dimension &d2)
| Compute bounding box of both dimensions. More...
Rect | BoundingRect (const Rect &r1, const Rect &r2)
| Compute the bounding rectangle around two rectangles. More...

## Detailed Description

Geometry functions.

Definition in file geometry_func.cpp.

## Function Documentation

## ◆ BoundingRect()

Rect BoundingRect | ( | const Rect & | r1,
|  | const Rect & | r2
| ) |  |

Compute the bounding rectangle around two rectangles.

Parameters

  r1 | First rectangle.
  r2 | Second rectangle.

Returns
  The bounding rectangle, the smallest rectangle that contains both arguments.

Definition at line 36 of file geometry_func.cpp.

References IsEmptyRect().

Referenced by VideoDriver_Win32Base::MakeDirty(), and VideoDriver_SDL_Base::MakeDirty().

## ◆ maxdim()

Dimension maxdim | ( | const Dimension & | d1,
|  | const Dimension & | d2
| ) |  |

Compute bounding box of both dimensions.

Parameters

  d1 | First dimension.
  d2 | Second dimension.

Returns
  The bounding box of both dimensions, the smallest dimension that surrounds both arguments.

Definition at line 22 of file geometry_func.cpp.

Referenced by VehicleGroupWindow::ComputeGroupInfoSize(), BaseVehicleListWindow::GetActionDropdownSize(), GetLargestCargoIconSize(), NetworkContentListWindow::OnInit(), DepotWindow::OnInit(), SelectCompanyManagerFaceWindow::OnInit(), GameSettingsWindow::OnInit(), IndustryCargoesWindow::OnInit(), NWidgetBackground::SetupSmallestSize(), and NWidgetLeaf::SetupSmallestSize().