-
-
Notifications
You must be signed in to change notification settings - Fork 23.3k
Fix TextEdit clips children and focus style. #109078
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about the rendering server methods to add canvas items, but it seems to work fine.
Some minor issues:
CodeEdit::_draw_guidelines
still uses theme_cache.style_normal
.
TextEdit::set_editable
should call update_minimum_size()
.
040823c
to
24e19a4
Compare
8303df9
to
31485d3
Compare
31485d3
to
fe8b693
Compare
fe8b693
to
5f178e2
Compare
The half line spacing we add to offset the text should be removed or double checked if it's taken into account in all other calculations like |
c140ed7
to
f12a8bd
Compare
f12a8bd
to
e1ff26a
Compare
Moved the styles fix to another PR #110527, will keep this PR fixing only the clipping issues. |
0af4e9d
to
2e9f911
Compare
2e9f911
to
5257372
Compare
I think it will have to be considered there. I've been looking for some inconsistency with related calculations, so thanks for pointing that out. This can be done later though, the behavior in #110527 get_line_column_at_pos is good for now. It can be more easily seen with the cross cursor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
- This also fixes #74445 since the expand margins now work by default .
- I don't think this fixes #42342 I think it is talking about how the text doesn't get clipped accurately when there is a content margin on a per pixel bases, though it is hard to tell.
Note that TextEdit's clip_contents default value changed, but this is needed to fix the issues.
5257372
to
9eb5b60
Compare
Co-Authored-By: kit <[email protected]>
9eb5b60
to
b25e35c
Compare
Thanks! |
This PR refactors TextEdit to stop clipping its children and now uses its own CanvasItem logic for drawing text.
Changes:
Note: This PR is not intended to change any existing behavior due to the complexity of the
TextEdit
class. The only goal is to resolve the mentioned issues and improve internal drawing consistency.