| 607 | } |
| 608 | |
| 609 | void OnResize() override |
| 610 | { |
| 611 | if (this->viewport != nullptr) { |
| 612 | NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_N_VIEWPORT); |
| 613 | nvp->UpdateViewportCoordinates(this); |
| 614 | |
| 615 | if (!std::holds_alternative<VehicleID>(ni->ref1)) { |
| 616 | ScrollWindowToTile(GetReferenceTile(ni->ref1), this, true); // Re-center viewport. |
| 617 | } |
| 618 | } |
| 619 | |
| 620 | NWidgetResizeBase *wid = this->GetWidget<NWidgetResizeBase>(WID_N_MGR_NAME); |
| 621 | if (wid != nullptr) { |
| 622 | int y = GetStringHeight(GetString(STR_JUST_RAW_STRING, static_cast<const CompanyNewsInformation *>(this->ni->data.get())->president_name), wid->current_x); |
| 623 | if (wid->UpdateVerticalSize(y)) this->ReInit(0, 0); |
| 624 | } |
| 625 | } |
| 626 | |
| 627 | /** |
| 628 | * Some data on this window has become invalid. |
nothing calls this directly
no test coverage detected