-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Popups (OptionButton, tooltips) placed and scaled wrong when using canvas_items
stretch mode or scale factor different from 1.0
(DisplayServer regression)
#54030
Comments
This is because multiple windows are now used by default (this applies to PopupMenus so they can extend outside the project window). However, child windows are currently not scaled with the scale factor automatically determined by the #50680 would resolve this by default, but in the meantime, you can enable Embed Subwindows in the Project Settings. |
canvas_items
stretch mode (DisplayServer regression)
@Calinou Ok, "Embed Subwindows" places it correctly, but instead of selecting items, popup just closes, so it seems it's not a workaround. |
Looks like the regression part is fixed. The popup works correctly when you use embedded subwindows (default). |
I tested the behavior in godotengine/godot-demo-projects#713 with commit 83d2673, and popup drawing is still blurry when using a larger-than-default window size with the The icon drawing will always be blurry as it's not re-rasterized for higher window sizes, but the StyleBox and font drawing could be made sharp as they would be in (Embed Subwindows is enabled here.) |
cc @Sauermann Is this something you might've fixed recently? |
I can confirm that this problem is solved.
I am not yet familiar with the rendering-functionality to properly investigate this second issue. |
#86553 has been merged. Has the problem of blurred fonts in embedded sub-windows been resolved? |
This issue doesn't appear to be fixed yet as of 4.3.dev 2efbc6b (tested on https://github.com/godotengine/godot-demo-projects/tree/master/3d/graphics_settings): As the PR's description says:
Default project window sizeFullscreen in
|
I see no change on my project either (same as above). Might improve specific situations, but not the one I hit (pop-up windows within the app). I can't switch them to non-embedded, because then on desktop OSs they appear as separate windows which is not desirable at all. |
Now that non-embedded popups/tooltip scaling is fixed, it might be worth experimenting with the Project embed subwindows disabled. For popup panels, you can hide the title bar and use your own code for clamping the window movement to remain inside the main window so that it acts pretty much like an embedded popup. |
I had a similar issue when using my own pixel font. The root problem in my case being that Windows get their own viewport and default canvas item filters aren't inherited. I fixed this issue by manually setting the default filtering for each OptionButton like this: $OptionButton.get_popup().get_viewport().canvas_item_default_texture_filter = 0 You can also extend the OptionButton control to one that copies the filtering of the parent node's viewport like this: extends OptionButton
func _ready() -> void:
get_popup().get_viewport().canvas_item_default_texture_filter = get_viewport().canvas_item_default_texture_filter I don't think this is the solution most people in here need, but it might be useful to other people like me who ended up here looking for answers. |
Disabling project embed subwindows fixes the issue. As @Koyper said, I too can recommend experimenting with it. Seems like embedded subwindows is still broken. |
Is it very naive to ask, how the editor itself handles UI scaling then? Doesn't the editor use the same settings for scaling its UI? Because it seems to work fine for the editor in the cases of OptionButton Popups for example (as well as all the other Controls that spawn new Viewports/Windows). |
The editor regenerates its theme with the specified scale factor and font size from the Editor Settings. It does not use the content scale factor functionality of Godot – it always uses the This approach is mostly used for historical reasons. Note that #86022 overhauls how editor scaling is performed. |
canvas_items
stretch mode or scale factor different from 1.0
(DisplayServer regression)canvas_items
stretch mode or scale factor different from 1.0
(DisplayServer regression)
This comment was marked as off-topic.
This comment was marked as off-topic.
Is there a workaround in 4.3 for Dialogs (AcceptDialog, ConfirmationDialog, ...) ? I want to release a demo of my game but the Dialogs' text looks extremely blurry. I don't care if I have to add code to every single dialog one by one to fix it, but I don't know how. I tried gokiburikin's fix above and it makes the text look less blurry, but still wrong (some kind of scaling issue with letters having uneven sizes in the same word). Any idea why? |
try #97745 ?
|
Related issue #95387 |
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version
4.0-dev.20211004_win64
System information
Windows 10
Issue description
When using OptionButton and choosing canvas_items mode in Project Settings->Display, popup of OptionButton is placed and scaled wrong (fonts too). When using "disabled" mode it is placed correctly.
I originally thought that this is related to my custom size of display, but it seems only "canvas_items" does this.
I've added project, so you can test. but it's pretty obvious, I have no scaling or complex settings on nodes.
Steps to reproduce
Set canvas_items mode and use PopupButton.
Minimal reproduction project
game-client_issue_popup_menu.zip
The text was updated successfully, but these errors were encountered: