FAForever / fa

Lua code for FAF
221 stars 228 forks source link

Fix unit view clipping in replays for the mini layout #6291

Closed PaletzTheWise closed 1 day ago

PaletzTheWise commented 1 week ago

Description of the proposed changes

Before: image After: image

I have changed the unit view positioning in replays for the mini layout to the same as the right layout, which is effectively an identical layout because they differ only in: 1) The orders control position but there is no orders control in replays. 2) The clipping issue itself, which I assume is not intended :)

In order to achieve that, I have added a condition that checks whether the orders control exists.

Additionally, I have moved imports in layouts to the top of the file since that is tradition, it avoids import duplication in some cases and it is theoretically faster (it saves up to 30% processing time of the PositionWindow() method, but that still amounts to nothing in the grand scheme of things).

No changes to non-replay positioning of the mini layout: image

Testing done on the proposed changes

Replay testing:

Skirmish testing:

Skirmish observer testing:

Additional context

I wondered if Gyle runs into this in his casts but he mostly selects combat units that do not have the extra bits at the top of the construction control.

Checklist

MrRowey commented 4 days ago

@PaletzTheWise Dose this scale properly when people use UI Scale ingame?

PaletzTheWise commented 2 days ago

@PaletzTheWise Dose this scale properly when people use UI Scale ingame?

Yes, I have checked all layouts in a replay on 80%, 125%, and 200%. Found no inconsistencies.