1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 04:23:20 +01:00

Fix off-by-one pixel issue in active widget width and height setters

This commit is contained in:
Basssiiie
2024-08-02 21:16:22 +02:00
committed by GitHub
parent b1e2ca94c7
commit e2641668a4
2 changed files with 5 additions and 4 deletions

View File

@@ -37,6 +37,7 @@
- Fix: [#22339] Printing ui.tool.cursor in console crashes the game.
- Fix: [#22348] Progress bar screen doesnt handle window resizing.
- Fix: [#22389] Alpine coaster has wrong tunnel entrance type.
- Fix: [#22435] [Plugin] Off-by-one pixel issue in active widget width and height setters.
0.4.12 (2024-07-07)
------------------------------------------------------------------------

View File

@@ -207,7 +207,7 @@ namespace OpenRCT2::Scripting
auto widget = GetWidget();
if (widget != nullptr)
{
return widget->width();
return widget->width() + 1;
}
return 0;
}
@@ -216,7 +216,7 @@ namespace OpenRCT2::Scripting
auto widget = GetWidget();
if (widget != nullptr)
{
auto delta = widget->left + value - widget->right;
auto delta = widget->left + value - (widget->right + 1);
Invalidate();
widget->right += delta;
@@ -246,7 +246,7 @@ namespace OpenRCT2::Scripting
auto widget = GetWidget();
if (widget != nullptr)
{
return widget->height();
return widget->height() + 1;
}
return 0;
}
@@ -255,7 +255,7 @@ namespace OpenRCT2::Scripting
auto widget = GetWidget();
if (widget != nullptr)
{
auto delta = widget->top + value - widget->bottom;
auto delta = widget->top + value - (widget->bottom + 1);
Invalidate();
widget->bottom += delta;