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

imguidatechooser does not display correctly #69

Open
aCuria opened this issue Jan 31, 2023 · 4 comments
Open

imguidatechooser does not display correctly #69

aCuria opened this issue Jan 31, 2023 · 4 comments

Comments

@aCuria
Copy link

aCuria commented Jan 31, 2023

When windows dpi scaling is respected, for example:

static float scale = 1.0;
auto currentMonitorScale = getWindow().getCurrentMonitorContentScale(); // this is glfwGetWindowContentScale()

if (currentMonitorScale.y != scale)
{
	ImGui::GetStyle().ScaleAllSizes(currentMonitorScale.y / scale);
	ImGui::GetIO().FontGlobalScale = currentMonitorScale.y;
	scale = currentMonitorScale.y;
}

Then imguidatechooser ends up rendering a scrollbar which blocks the UI.

Example at 350% display scaling
image

@aCuria
Copy link
Author

aCuria commented Jan 31, 2023

To be clear the issue also shows up at anywhere above 125%+ display scaling setting in windows. It is not exclusive to the 350% example image

@Flix01
Copy link
Owner

Flix01 commented Jan 31, 2023

Unluckily I don't own a Mac, so I can't reproduce this behavior, and fix it.
I don't even know what "windows dpi scaling is respected" means 🥲 !

Some question to better understand the issue:

  • If you run the demo without your scaling code, does it look better?
  • Is it something related to "retina-display" screens or something like that?
  • Is imguidatechooser the only widget that gets broken with your "scaling code" or it affects other widgets too?
  • And does it cause artifacts in plain Dear ImGui demos (I mean in the upstream repository, not in my Addons)?

If I can't replicate the problem, I still accept a Pull Request by users.

But if you just need a DateChooser widget and nothing more, you can try and see if the one made by @epezent:
image
inside imguiplot is more robust than mine (for sure it looks better!).
I've discoved it HERE. And if you plan to use imguiplot you get it for free, otherwise you must extract the relative code to test it.

@aCuria
Copy link
Author

aCuria commented Feb 1, 2023

This is microsoft windows, not Mac OS. You can access the windows scaling setting using

Settings > Display > Scale & Layout > Scale = 200%

The idea is to have a larger UI when using a high dpi screen, for example 4k on a 13" laptop

Thanks for the heads up on epezent's date chooser, thats actually more suitable because it has time which I need too.

You can reproduce it by setting currentMonitorScale.y to 2.0 which represents 200% scaling.

@Flix01
Copy link
Owner

Flix01 commented Feb 1, 2023

Settings > Display > Scale & Layout > Scale = 200%

Tried: the screen zoomed 4 times, I could only interact with the top-left corner of the screen, and had to hard reset the system.
No options to scale below 100%.
So in short I cannot test any code with Scale!=100% on my PC.

Thanks for the heads up on epezent's date chooser, thats actually more suitable because it has time which I need too.

You're welcome. implot is made by a single .h/.cpp file so it should be easy to use.

P.S. I'm on Ubuntu Linux not on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants