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

Fix multiline items drawing in Tree #76532

Merged
merged 1 commit into from
May 10, 2023

Conversation

dalexeev
Copy link
Member

Closes #76507.

@dalexeev dalexeev requested a review from a team as a code owner April 28, 2023 07:52
@@ -1907,6 +1905,7 @@ void Tree::update_item_cell(TreeItem *p_item, int p_col) {
font_size = theme_cache.font_size;
}
p_item->cells.write[p_col].text_buf->add_string(valtext, font, font_size, p_item->cells[p_col].language);
p_item->cells.write[p_col].text_buf->set_break_flags(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::BREAK_ADAPTIVE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap mode probably should be exposed as item property (similar to Label and other controls).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be done as a separate PR, as AutowrapMode includes more than just LineBreakFlag.

Copy link
Contributor

@capnm capnm Apr 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the start LineBreakFlag would e.g. fix this here in editor.
More then one line makes it IMO unreadable, for more info we have the tooltip.
image

@dalexeev dalexeev force-pushed the tree-fix-multiline-drawing branch from 309b3b0 to 865d6f5 Compare April 28, 2023 09:02
@dalexeev
Copy link
Member Author

I haven't been able to reproduce this in a test project, it only happens in the editor. I copied the editor theme to the project, but the error still doesn't appear.

@akien-mga akien-mga merged commit 4d70328 into godotengine:master May 10, 2023
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

Problems rendering multiline items in Tree.
5 participants