Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report 'Game Mode' or 'Editor Mode' button in UI doesn't show completely #92

Closed
CRAFTSTARCN opened this issue Apr 9, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@CRAFTSTARCN
Copy link
Contributor

Describe the bug | Bug描述
Latest version (e5d43bc
Incomplete presentation of 'Game Mode' or 'Editor Mode' Button

Steps to reproduce | 如何复现

  1. Just open the Pilot Engine

Expected behavior | 预期行为
It shall show the complete text.

Screenshots/Logs | 截图/日志
ErrorButton

Desktop | 桌面环境

  • OS: Windows
  • Version: 10
  • CPU: 15-9400H
  • GPU: NVIDIA GeForce GTX 1660Ti
  • Memory: 16GB
  • Compiler: MSVC2019
  • Screen resolution: 1920x1080
@CRAFTSTARCN CRAFTSTARCN added the bug Something isn't working label Apr 9, 2022
@CRAFTSTARCN CRAFTSTARCN changed the title Bug Report Bug Report 'Game Mode' or 'Editor Mode' button in UI doesn't show completely Apr 9, 2022
@iaomw
Copy link
Contributor

iaomw commented Apr 12, 2022

What is your resolution scale at 1080p?
Is that 100% or something like 150%?

@CRAFTSTARCN
Copy link
Contributor Author

What is your resolution scale at 1080p? Is that 100% or something like 150%?

it's 125%, recommand by windows for my laptop, I think I shall use 100% instead of 125%, thanks.

@iaomw
Copy link
Contributor

iaomw commented Apr 13, 2022

What is your resolution scale at 1080p? Is that 100% or something like 150%?

it's 125%, recommand by windows for my laptop, I think I shall use 100% instead of 125%, thanks.

Thanks. This bug exposes another design issue on ImGui. It doesn't consider DPI seriously from scratch.
The button overlapped is behind ImGui::Indent. I am not sure it' the only way to put a button on right side.

ImGui::Indent(indent_val) should also consider DPI scale. But it's using some fixed with respecting to right edge.

A quick fix indent_val = m_engine_window_size.x - 100.0f * ImGui::GetWindowDpiScale();
But GetWindowDpiScale is fixed at launch, it will not change with your screen setting at running.

It's easy to do a quick fix, but code structure will looks a bit messed up. Because I am not familiar with the project.

There are 2 major reasons for DPI issues.

  • ImGui doesn't consider DPI in its API design.
  • GLFW behaviors differently on Windows and macOS( not sure on Linux ), the differences will have injected into ImGui.

There will be at least 3 different approaches to fix all DPI issues:

  • Fix with GLFW, may have side effect on other GLFW APIs.
  • Some workaround with ImGui, may break other things.
  • Many dirty fixes in engine, here and there.

@hyv1001
Copy link
Collaborator

hyv1001 commented Apr 15, 2022

Should be fixed by #118, plz reopen if still exists

@hyv1001 hyv1001 closed this as completed Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants