Merge pull request #17836 from lalip/fix/17754

Fix [#17544, #17754]: Visual glitches in Invention List window
This commit is contained in:
Michael Steenbeek 2022-08-16 19:21:43 +02:00 committed by GitHub
commit 26825a7a9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -27,6 +27,7 @@
- Fix: [#17535] Multiplayer desync when placing rides with scenery. - Fix: [#17535] Multiplayer desync when placing rides with scenery.
- Fix: [#17541] Station style not correctly saved to TD6. - Fix: [#17541] Station style not correctly saved to TD6.
- Fix: [#17542] Stalls will autorotate towards paths outside the park. - Fix: [#17542] Stalls will autorotate towards paths outside the park.
- Fix: [#17544, #17754] Visual glitches in Invention List window.
- Fix: [#17553] Crash when moving invention list items to empty list. - Fix: [#17553] Crash when moving invention list items to empty list.
- Fix: [#17571] All researched tracked rides show up as new vehicles in .park scenarios. - Fix: [#17571] All researched tracked rides show up as new vehicles in .park scenarios.
- Fix: [#17600] Notifications are not properly cleared when loading a park. - Fix: [#17600] Notifications are not properly cleared when loading a park.

View File

@ -414,7 +414,7 @@ public:
const auto clipHeight = bkWidget.height() - 1; const auto clipHeight = bkWidget.height() - 1;
if (clip_drawpixelinfo(&clipDPI, &dpi, screenPos, clipWidth, clipHeight)) if (clip_drawpixelinfo(&clipDPI, &dpi, screenPos, clipWidth, clipHeight))
{ {
object->DrawPreview(&clipDPI, clipWidth, height); object->DrawPreview(&clipDPI, clipWidth, clipHeight);
} }
} }
@ -509,6 +509,12 @@ public:
return item == _selectedResearchItem; return item == _selectedResearchItem;
} }
// hack to fix #17544: OnScrollMouseOver never gets called while dragging
void SetSelectedResearchItem(ResearchItem* item)
{
_selectedResearchItem = item;
}
void MoveResearchItem(const ResearchItem& item, ResearchItem* beforeItem, bool isInvented) void MoveResearchItem(const ResearchItem& item, ResearchItem* beforeItem, bool isInvented)
{ {
_selectedResearchItem = nullptr; _selectedResearchItem = nullptr;
@ -597,6 +603,7 @@ public:
auto* research = res.has_value() ? res->research : nullptr; auto* research = res.has_value() ? res->research : nullptr;
if (!inventionListWindow->IsResearchItemSelected(research)) if (!inventionListWindow->IsResearchItemSelected(research))
{ {
inventionListWindow->SetSelectedResearchItem(research);
inventionListWindow->Invalidate(); inventionListWindow->Invalidate();
} }
} }