OpenTTD Source 20241224-master-gf74b0cf984
geometry_func.hpp File Reference

Geometry functions. More...

#include "geometry_type.hpp"

Go to the source code of this file.

Functions

Dimension maxdim (const Dimension &d1, const Dimension &d2)
 Compute bounding box of both dimensions.
 
bool IsEmptyRect (const Rect &r)
 Check if a rectangle is empty.
 
Rect BoundingRect (const Rect &r1, const Rect &r2)
 Compute the bounding rectangle around two rectangles.
 

Detailed Description

Geometry functions.

Definition in file geometry_func.hpp.

Function Documentation

◆ BoundingRect()

Rect BoundingRect ( const Rect r1,
const Rect r2 
)

Compute the bounding rectangle around two rectangles.

Parameters
r1First rectangle.
r2Second 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_SDL_Base::MakeDirty(), and VideoDriver_Win32Base::MakeDirty().

◆ IsEmptyRect()

bool IsEmptyRect ( const Rect r)
inline

Check if a rectangle is empty.

Parameters
rRectangle to check.
Returns
True if and only if the rectangle doesn't define space.

Definition at line 22 of file geometry_func.hpp.

Referenced by BoundingRect(), VideoDriver_SDL_Default::Paint(), VideoDriver_Win32GDI::Paint(), and OpenGLBackend::ReleaseVideoBuffer().

◆ maxdim()

Dimension maxdim ( const Dimension d1,
const Dimension d2 
)

Compute bounding box of both dimensions.

Parameters
d1First dimension.
d2Second 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(), GetRailTypeDropDownList(), GetStringListBoundingBox(), SelectCompanyManagerFaceWindow::OnInit(), DepotWindow::OnInit(), IndustryCargoesWindow::OnInit(), NetworkContentListWindow::OnInit(), GameSettingsWindow::OnInit(), NWidgetBackground::SetupSmallestSize(), NWidgetLeaf::SetupSmallestSize(), AIConfigWindow::UpdateWidgetSize(), BuildAirportWindow::UpdateWidgetSize(), ReplaceVehicleWindow::UpdateWidgetSize(), BootstrapAskForDownloadWindow::UpdateWidgetSize(), BuildBridgeWindow::UpdateWidgetSize(), BuildVehicleWindow::UpdateWidgetSize(), SelectCompanyLiveryWindow::UpdateWidgetSize(), SelectCompanyManagerFaceWindow::UpdateWidgetSize(), CompanyWindow::UpdateWidgetSize(), SetDateWindow::UpdateWidgetSize(), ErrmsgWindow::UpdateWidgetSize(), SaveLoadWindow::UpdateWidgetSize(), GenerateLandscapeWindow::UpdateWidgetSize(), CreateScenarioWindow::UpdateWidgetSize(), GoalListWindow::UpdateWidgetSize(), BaseGraphWindow::UpdateWidgetSize(), PaymentRatesGraphWindow::UpdateWidgetSize(), IndustryProductionGraphWindow::UpdateWidgetSize(), VehicleGroupWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), IndustryDirectoryWindow::UpdateWidgetSize(), LinkGraphLegendWindow::UpdateWidgetSize(), AboutWindow::UpdateWidgetSize(), MusicTrackSelectionWindow::UpdateWidgetSize(), MusicWindow::UpdateWidgetSize(), NetworkContentListWindow::UpdateWidgetSize(), NetworkGameWindow::UpdateWidgetSize(), NetworkStartServerWindow::UpdateWidgetSize(), NetworkClientListWindow::UpdateWidgetSize(), NetworkJoinStatusWindow::UpdateWidgetSize(), SpriteAlignerWindow::UpdateWidgetSize(), NewGRFParametersWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), NewsWindow::UpdateWidgetSize(), OrdersWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), CustomCurrencyWindow::UpdateWidgetSize(), SignListWindow::UpdateWidgetSize(), CompanyStationsWindow::UpdateWidgetSize(), SelectStationWindow< T >::UpdateWidgetSize(), StatusBarWindow::UpdateWidgetSize(), StoryBookWindow::UpdateWidgetSize(), SubsidyListWindow::UpdateWidgetSize(), TownAuthorityWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), VehicleListWindow::UpdateWidgetSize(), and VehicleDetailsWindow::UpdateWidgetSize().