Update to 13.2 (github source)
This commit is contained in:
+5
-5
@@ -101,7 +101,7 @@ public:
|
||||
|
||||
if (!this->cargo_acceptance.empty()) {
|
||||
uint width = GetStringBoundingBox(this->cargo_acceptance).width + WidgetDimensions::scaled.frametext.Horizontal();
|
||||
size->width = std::max(size->width, std::min(300u, width));
|
||||
size->width = std::max(size->width, std::min(static_cast<uint>(ScaleGUITrad(300)), width));
|
||||
SetDParamStr(0, cargo_acceptance);
|
||||
size->height += GetStringHeight(STR_JUST_RAW_STRING, size->width - WidgetDimensions::scaled.frametext.Horizontal());
|
||||
}
|
||||
@@ -706,9 +706,9 @@ struct TooltipsWindow : public Window
|
||||
/* Correctly position the tooltip position, watch out for window and cursor size
|
||||
* Clamp value to below main toolbar and above statusbar. If tooltip would
|
||||
* go below window, flip it so it is shown above the cursor */
|
||||
pt.y = Clamp(_cursor.pos.y + _cursor.total_size.y + _cursor.total_offs.y + 5, scr_top, scr_bot);
|
||||
pt.y = SoftClamp(_cursor.pos.y + _cursor.total_size.y + _cursor.total_offs.y + 5, scr_top, scr_bot);
|
||||
if (pt.y + sm_height > scr_bot) pt.y = std::min(_cursor.pos.y + _cursor.total_offs.y - 5, scr_bot) - sm_height;
|
||||
pt.x = sm_width >= _screen.width ? 0 : Clamp(_cursor.pos.x - (sm_width >> 1), 0, _screen.width - sm_width);
|
||||
pt.x = sm_width >= _screen.width ? 0 : SoftClamp(_cursor.pos.x - (sm_width >> 1), 0, _screen.width - sm_width);
|
||||
|
||||
return pt;
|
||||
}
|
||||
@@ -1151,8 +1151,8 @@ struct QueryWindow : public Window {
|
||||
void FindWindowPlacementAndResize(int def_width, int def_height) override
|
||||
{
|
||||
/* Position query window over the calling window, ensuring it's within screen bounds. */
|
||||
this->left = Clamp(parent->left + (parent->width / 2) - (this->width / 2), 0, _screen.width - this->width);
|
||||
this->top = Clamp(parent->top + (parent->height / 2) - (this->height / 2), 0, _screen.height - this->height);
|
||||
this->left = SoftClamp(parent->left + (parent->width / 2) - (this->width / 2), 0, _screen.width - this->width);
|
||||
this->top = SoftClamp(parent->top + (parent->height / 2) - (this->height / 2), 0, _screen.height - this->height);
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user