mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 20:13:07 +01:00
Extract ScreenRect from Graph for reusability
This commit is contained in:
@@ -189,41 +189,6 @@ struct FinancialTooltipInfo
|
||||
const money32 money{};
|
||||
};
|
||||
|
||||
struct ScreenRect
|
||||
{
|
||||
const ScreenCoordsXY LeftTop;
|
||||
const ScreenCoordsXY RightBottom;
|
||||
|
||||
int32_t GetLeft() const
|
||||
{
|
||||
return LeftTop.x;
|
||||
}
|
||||
int32_t GetTop() const
|
||||
{
|
||||
return LeftTop.y;
|
||||
}
|
||||
int32_t GetRight() const
|
||||
{
|
||||
return RightBottom.x;
|
||||
}
|
||||
int32_t GetBottom() const
|
||||
{
|
||||
return RightBottom.y;
|
||||
}
|
||||
int32_t GetWidth() const
|
||||
{
|
||||
return RightBottom.x - LeftTop.x;
|
||||
}
|
||||
int32_t GetHeight() const
|
||||
{
|
||||
return RightBottom.y - LeftTop.y;
|
||||
}
|
||||
bool Contains(const ScreenCoordsXY& coords) const
|
||||
{
|
||||
return coords.x >= GetLeft() && coords.x <= GetRight() && coords.y >= GetTop() && coords.y <= GetBottom();
|
||||
}
|
||||
};
|
||||
|
||||
static constexpr auto CHART_MAX_DATA_COUNT = 64;
|
||||
static constexpr auto CHART_MAX_INDEX = CHART_MAX_DATA_COUNT - 1;
|
||||
static constexpr auto CHART_DATA_WIDTH = 6;
|
||||
|
||||
Reference in New Issue
Block a user