Improve icon alignments on main and game screens

This commit is contained in:
Nab authored and GitHub committed 2025-08-12 22:10:21 +02:00
1 parent 9912aa5c8d
commit 3259757a57
2 files changed
+13 -7

No files matched your search

+2 -1
View File
@@ -757,10 +757,11 @@ void GameIconView::Draw(UIContext &dc) {
// Adjust size so we don't stretch the image vertically or horizontally.
// Make sure it's not wider than 144 (like Doom Legacy homebrew), ugly in the grid mode.
float nw = std::min(bounds_.h * textureWidth_ / textureHeight_, (float)bounds_.w);
int x = bounds_.x + (bounds_.w - nw) / 2.0f;
dc.Flush();
dc.GetDrawContext()->BindTexture(0, texture);
dc.Draw()->Rect(bounds_.x, bounds_.y, nw, bounds_.h, color);
dc.Draw()->Rect(x, bounds_.y, nw, bounds_.h, color);
dc.Flush();
dc.RebindTexture();
}