ShadowTheAge / yafc

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

[BUG] Tooltip UI gets cut off for large recipes #208

Open lukaskollmer opened 1 year ago

lukaskollmer commented 1 year ago

(I'm using the latest version of YAFC)

Not sure if this is actually a bug and not just a result of my screen potentially being too small, but large recipes (large w.r.t. their number of inputs and outputs) cause the tooltip view to be only partially visible, with the topmost (and bottommost?) parts being off-screen.

My screen size is 3024 × 1964 (14" MacBook Pro), which i guess shouldn't be too uncommon. Idk how difficult this would be to change (if it is possible at all), so I don't wanna make unreasonable suggestions, but here's some ideas:

DaleStan commented 1 year ago

I agree we shouldn't assume everyone has a 4k screen, but I'm not sure what you're doing here.

With a slightly different set of mods, I see this on my 2560×1440 screen: image

It would still have troubles on a 1920×1080 screen, but your 3024×1964 should be just fine.

lukaskollmer commented 1 year ago

i think it's because, while the native screen resolution is 3024×1964, YAFC is rendered at 2x, so the effective resolution is actually just 1512x982

veger commented 1 year ago

I have similar issues on my laptop which has a smaller screen than my desktop monitors.

I have been thinking to take a stab at this, but since UI/SDL is not my strong suit I didn't think too much on the problem and potential solutions. Bit I think, as you also propose, a redesign of the tooltip is our best bet to fix this issue.

For my summary view I had to jump to hoops to figure out ways to find the height of the 'parent space' in order to make the 2D scrollable object fill this whole space. So I doubt scaling to fit the available space is going to be possible (again SDL is not my string suit, so I might have missed something obvious)