Codechange: Rename CenterBounds to CentreBounds and move to geometry header. (#14002)

This commit is contained in:
Peter Nelson
2025-04-14 23:55:40 +01:00
committed by GitHub
parent fc20ce301a
commit 5008568dfc
29 changed files with 63 additions and 64 deletions

View File

@@ -16,6 +16,17 @@
# define Point OTTD_Point
#endif /* __APPLE__ */
/**
* Determine where to position a centred object.
* @param min The top or left coordinate.
* @param max The bottom or right coordinate.
* @param size The height or width of the object to draw.
* @return Offset of where to position the object.
*/
inline int CentreBounds(int min, int max, int size)
{
return (min + max - size + 1) / 2;
}
/** Coordinates of a point in 2D */
struct Point {