Uh oh!
There was an error while loading. Please reload this page.
Draw minimap with correct aspect ratio - #485
Conversation
Indy2222
commented
Jun 11, 2023
I think that a good solution should have these properties:
|
Zakru
commented
Jun 11, 2023
Indy2222
commented
Jun 11, 2023
Yes, your drawing illustrates well what I meant. You are right about the action bar, it should horizontally end where the minimap begins. |
Indy2222
commented
Jun 11, 2023
Zakru
commented
Jun 16, 2023
Got a bit stuck on this one, it seems to me like the aspect ratio constraint works only in only one direction while the other has a size constraint, but other than that it might not be able to "expand to fit" with just the vanilla Also feedback on the new code layout is welcome, since the bottom HUD is now a flexbox so a hierarchy is needed. Right now, I have the container defined in |
Indy2222
commented
Jun 16, 2023
I would try to explore the padding trick (https://css-tricks.com/aspect-ratio-boxes/). If that doesn't lead anywhere, we might need to implement a system which on change of the window resolution recalculates the sizes of the nodes and changes them. This should be pretty simple system and a small modification.
I would try to minimize changes in this PR and postpone any unnecessary code structuring changes to a separate PR. I'll do a proper review once we arrive at a solution which works. I quickly tried to find a simple solution in which we do not have to (re)calculate the size in a system, but without success. |
Zakru
commented
Jun 17, 2023
I also actually wish to not do this here. The logic was that technically when the minimap size changes, there's a gap/overlap between it and the action bar, but I guess that might be a non-issue at this point.
Couldn't get this to work, might just be me, although I think it's the fact that we want to constrain the size in both directions while maintaining the aspect ratio, and have it expand to the max size possible. Everything I've seen just shows a size constraint on one axis, while the aspect ratio controls the other. |
Indy2222
commented
Jun 17, 2023
We will limit the aspect ration for maps anyways (#375) so setting just height (or width) and leaving the other dimension to grow/shrink might be sufficient. Would that be easier to achieve? |
Zakru
commented
Jun 17, 2023
I think that would be significantly easier. For example, fix the width to 20% of the screen, and have the maps only be wide rectangles (or do the opposite and fix the height, whichever). With this approach, even if we allow the opposite aspect ratio, we could just rotate the map a quarter turn and get the shape we want. Would also make the visuals more consistent imo. |
Indy2222
commented
Jun 17, 2023
Ok, so lets rework the implementation in this PR so that the width is fixed at 20%. We can limit aspect ratio of the maps from 2:1 to 1:1. |
For now we only constrain width. FixesDigitalExtinction#376


Fixes#376