shpaass / yafc-ce

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
54 stars 20 forks source link

Summary is not redrawn on focus #169

Open shpaass opened 3 months ago

shpaass commented 3 months ago

Steps to reproduce:

image

image

I think the solution to the problem would be to redraw any tab on focus.

shpaass commented 3 months ago

Here's the project file: project.zip

veger commented 3 months ago

It is a known visual glitch that sometimes happens: https://github.com/have-fun-was-taken/yafc-ce/pull/161#issuecomment-2178484035:

Sometimes the scrollbars are drawn in the wrong place, triggering a UI (re)build (by clicking something for example) puts the bars to the correct places. I think it is because the UI contents is repositioned by the Scrollable cause the scrollarea dimensions to change. A followup rebuild uses the new dimensions, causing the bars to move to the correct places. (Fixing this would mean a complete overhaul of the UI system, as there is no way to find the bottom (height)/right (width) of the 'left over' area where the scrollable component needs to be placed. (The UI is 'fluid' and is build from the top/left)

I think we would need to rebuild the UI in some specific cases, which currently do not trigger a rebuild, to fix this. No idea which exact cases yet/though :smile: When I (want to) take a look at it, it doesn't happen. And when I am unaware I realize(d) it happened again...

shpaass commented 3 months ago

Here's the save file with mods on which the Yafc project was loaded: summary_not_redrawn.zip

veger commented 3 months ago

Thanks, if this is an opportunity to have a reproducible case it would help figuring out what is going on!

veger commented 3 months ago

Unfortunately, I cannot reproduce.

And this is the result: image

All tabs are showing, the scrollbar is placed in the bottom, no other (visual) glitches are visible (to me).

shpaass commented 3 months ago

Tested just now.

image

veger commented 3 months ago

So it looks like, it is setup/OS dependent? :disappointed:

I am using Linux/KDE/Nvidia, I can try later on my desktop which runs Linux/KDE/AMD

shpaass commented 1 month ago

Please reopen this issue if the bug is reproducible on the recent versions.

DaleStan commented 1 month ago

I'm still seeing this. When working on #234, I used this project for testing. Bobs-save.zip Bobs.yafc.zip

After syncing mods and settings from the save, load the project, check "Only show issues" (primarily to make the behavior easier to see) and click "Auto balance". You will probably see only three columns, one each for water, hydrogen, and CO₂. (If you see more than five columns, click "Auto balance" again. Each click seems to have a 10%-25% chance of properly updating the table.) Optionally, uncheck "Only show issues". The hidden columns will appear to be properly balanced (e.g. Rocket fuel could show 106/s production and consumption on two pages of 50/s and 55.5/s.) If you uncheck "Only show issues", recheck it. To see the issue, hold Ctrl+Tab to sweep through all the tabs (the science packs are the last 8 tabs). When you get back to the Summary page, it will be redrawn with many columns, indicating that the previous display was using stale values.

This can usually be repeated around five times, before the project is fully balanced, and you have to undo or reload.