1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Replace SCROLLBAR_SIZE macro with kScrollBarWidth constant

This commit is contained in:
Aaron van Geffen
2024-08-07 14:45:38 +02:00
parent cbf739cf55
commit bc055f4031
2 changed files with 5 additions and 7 deletions

View File

@@ -82,7 +82,7 @@ namespace OpenRCT2::Ui::Windows
static int32_t getMapOffset(int16_t width)
{
return (width - getMiniMapWidth() - kReservedHSpace - SCROLLBAR_SIZE) / 2;
return (width - getMiniMapWidth() - kReservedHSpace - kScrollBarWidth) / 2;
}
// Some functions manipulate coordinates on the map. These are the coordinates of the pixels in the
@@ -649,7 +649,7 @@ static Widget window_map_widgets[] = {
auto mapOffset = getMapOffset(width);
if (mapOffset > 0)
{
adjCoords -= ScreenCoordsXY(mapOffset, mapOffset - SCROLLBAR_SIZE / 2);
adjCoords -= ScreenCoordsXY(mapOffset, mapOffset - kScrollBarWidth);
}
CoordsXY c = ScreenToMap(adjCoords);
@@ -718,7 +718,7 @@ static Widget window_map_widgets[] = {
auto screenOffset = ScreenCoordsXY(0, 0);
auto mapOffset = getMapOffset(width);
if (mapOffset > 0)
screenOffset += ScreenCoordsXY(mapOffset, mapOffset - SCROLLBAR_SIZE / 2);
screenOffset += ScreenCoordsXY(mapOffset, mapOffset - kScrollBarWidth);
G1Element g1temp = {};
g1temp.offset = _mapImageData.data();
@@ -1408,7 +1408,7 @@ static Widget window_map_widgets[] = {
width = initSize + kReservedHSpace;
height = initSize + kReservedTopSpace + GetReservedBottomSpace();
auto scrollbarSize = getTechnicalMapSize() > 254 ? SCROLLBAR_SIZE : 2;
auto scrollbarSize = getTechnicalMapSize() > 254 ? kScrollBarWidth : 2;
width += scrollbarSize;
height += scrollbarSize;
@@ -1423,7 +1423,7 @@ static Widget window_map_widgets[] = {
max_height = std::clamp(
getMiniMapWidth() + kReservedTopSpace + GetReservedBottomSpace(), WH, ContextGetHeight() - 68);
auto scrollbarSize = getMiniMapWidth() + kReservedHSpace > ContextGetWidth() ? SCROLLBAR_SIZE : 2;
auto scrollbarSize = getMiniMapWidth() + kReservedHSpace > ContextGetWidth() ? kScrollBarWidth : 2;
max_width += scrollbarSize;
max_height += scrollbarSize;
}

View File

@@ -286,8 +286,6 @@ enum SCROLL_FLAGS
VSCROLLBAR_DOWN_PRESSED = (1 << 7),
};
#define SCROLLBAR_SIZE 16
enum
{
SCROLL_PART_NONE = -1,