diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 95e79d1ead..5fd34e887f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -37,6 +37,7 @@ - Fix: [#22339] Printing ui.tool.cursor in console crashes the game. - Fix: [#22348] Progress bar screen doesn’t 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) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/scripting/ScWidget.hpp b/src/openrct2-ui/scripting/ScWidget.hpp index 37f05a95f9..5bb00ccd7f 100644 --- a/src/openrct2-ui/scripting/ScWidget.hpp +++ b/src/openrct2-ui/scripting/ScWidget.hpp @@ -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;