Fix vertical alignment of Inspector category titles#110303
Merged
Repiteo merged 1 commit intogodotengine:masterfrom Sep 17, 2025
Merged
Fix vertical alignment of Inspector category titles#110303Repiteo merged 1 commit intogodotengine:masterfrom
Repiteo merged 1 commit intogodotengine:masterfrom
Conversation
rsubtil
reviewed
Sep 7, 2025
Contributor
Author
|
Further investigation shows that this may be a platform specific issue. This doesn't seem to be a problem on other platforms, and while this PR fixes it on Windows, it causes a regression for other platforms. |
bruvzg
reviewed
Sep 8, 2025
Comment on lines
1681
to
1684
| float font_height = font->get_height(font_size); | ||
| float text_pos_y = get_size().height - (font_height / 2) + v_margin_offset; | ||
| Point2 text_pos = Point2(ofs, text_pos_y).round(); | ||
| draw_string(font, text_pos, label, HORIZONTAL_ALIGNMENT_LEFT, w, font_size, theme_cache.font_color); |
Member
There was a problem hiding this comment.
Ref<TextLine> tl;
tl.instantiate();
tl->add_string(label, font, font_size);
tl->set_width(w);
tl->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_LEFT);
float text_pos_y = (get_size().height - tl->get_size().height) / 2 + v_margin_offset;
Point2 text_pos = Point2(ofs, text_pos_y).round();
tl->draw(get_canvas_item(), text_pos, theme_cache.font_color);Using real text metrics should always work, regardless of fonts and system font fallbacks in use.
Contributor
Author
There was a problem hiding this comment.
I can confirm this works, at least on my end. Will need someone else to validate. I have integrated this into the PR
Unbansheee
added a commit
to Crab-Cafe/godot
that referenced
this pull request
Sep 9, 2025
# Conflicts: # editor/inspector/editor_inspector.cpp
Calinou
approved these changes
Sep 9, 2025
Calinou
reviewed
Sep 9, 2025
Member
|
Remember to squash commits into a single commit so this can be merged. |
Contributor
|
I tested this again, works as expected now. |
Contributor
|
Thanks! Congratulations on your first merged contribution! 🎉 |
ProfessorOctopus
pushed a commit
to ProfessorOctopus/godot
that referenced
this pull request
Sep 17, 2025
Fix vertical alignment of Inspector category titles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #110302
Before:

After:
