1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-15 16:32:41 +01:00

Change: Ability to set aspect ratio of a widget.

This allows setting the shape of a widget without dealing with absolute pixel sizes.
This commit is contained in:
Peter Nelson
2024-03-27 09:02:40 +00:00
committed by Peter Nelson
parent f267b37a33
commit d43ff8dc49
4 changed files with 95 additions and 0 deletions

View File

@@ -127,6 +127,7 @@ public:
}
this->smallest_x = this->children.front()->smallest_x + this->children.back()->smallest_x; // First and last are always shown, rest not
this->ApplyAspectRatio();
}
void AssignSizePosition(SizingType sizing, int x, int y, uint given_width, uint given_height, bool rtl) override